Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Unified Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc

Issue 1927203003: Add support for X11 workspaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implemented GetRestoredWorkspace, fix some formatting Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
index effa86484cfe77eed5aa00794ace06f8a866a8a6..32a26e4a1ffb2e7d9f6b1a23ba141e9a5cebc760 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -564,6 +564,14 @@ gfx::Rect DesktopWindowTreeHostX11::GetRestoredBounds() const {
return GetWindowBoundsInScreen();
}
+int DesktopWindowTreeHostX11::GetRestoredWorkspace() const {
+ int workspace_id;
+ if (ui::GetIntProperty(xwindow_, "_NET_WM_DESKTOP", &workspace_id))
+ return workspace_id;
+ else
sky 2016/05/02 15:11:23 nit: no else after a return.
Tom (Use chromium acct) 2016/05/02 20:32:37 Done.
+ return -1;
+}
+
gfx::Rect DesktopWindowTreeHostX11::GetWorkAreaBoundsInScreen() const {
return ToDIPRect(GetWorkAreaBoundsInPixels());
}
@@ -1226,6 +1234,9 @@ void DesktopWindowTreeHostX11::InitX11Window(
if (params.visible_on_all_workspaces) {
state_atom_list.push_back(atom_cache_.GetAtom("_NET_WM_STATE_STICKY"));
ui::SetIntProperty(xwindow_, "_NET_WM_DESKTOP", "CARDINAL", kAllDesktops);
+ } else if (params.workspace != -1) {
+ ui::SetIntProperty(xwindow_, "_NET_WM_DESKTOP", "CARDINAL",
+ params.workspace);
}
// Setting _NET_WM_STATE by sending a message to the root_window (with
@@ -1990,10 +2001,15 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
}
case PropertyNotify: {
::Atom changed_atom = xev->xproperty.atom;
- if (changed_atom == atom_cache_.GetAtom("_NET_WM_STATE"))
+ if (changed_atom == atom_cache_.GetAtom("_NET_WM_STATE")) {
OnWMStateUpdated();
- else if (changed_atom == atom_cache_.GetAtom("_NET_FRAME_EXTENTS"))
+ } else if (changed_atom == atom_cache_.GetAtom("_NET_FRAME_EXTENTS")) {
OnFrameExtentsUpdated();
+ } else if (changed_atom == atom_cache_.GetAtom("_NET_WM_DESKTOP")) {
+ int workspace_id;
+ if (ui::GetIntProperty(xwindow_, "_NET_WM_DESKTOP", &workspace_id))
+ OnHostWorkspaceChanged(workspace_id);
+ }
break;
}
case SelectionNotify: {

Powered by Google App Engine
This is Rietveld 408576698