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

Side by Side 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: Reverted ui/views/widget/desktop_aura/x11_desktop_handler.cc Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h"
6 6
7 #include <X11/Xatom.h> 7 #include <X11/Xatom.h>
8 #include <X11/Xregion.h> 8 #include <X11/Xregion.h>
9 #include <X11/Xutil.h> 9 #include <X11/Xutil.h>
10 #include <X11/extensions/XInput2.h> 10 #include <X11/extensions/XInput2.h>
(...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1219 1219
1220 // If the window should stay on top of other windows, add the 1220 // If the window should stay on top of other windows, add the
1221 // _NET_WM_STATE_ABOVE property. 1221 // _NET_WM_STATE_ABOVE property.
1222 is_always_on_top_ = params.keep_on_top; 1222 is_always_on_top_ = params.keep_on_top;
1223 if (is_always_on_top_) 1223 if (is_always_on_top_)
1224 state_atom_list.push_back(atom_cache_.GetAtom("_NET_WM_STATE_ABOVE")); 1224 state_atom_list.push_back(atom_cache_.GetAtom("_NET_WM_STATE_ABOVE"));
1225 1225
1226 if (params.visible_on_all_workspaces) { 1226 if (params.visible_on_all_workspaces) {
1227 state_atom_list.push_back(atom_cache_.GetAtom("_NET_WM_STATE_STICKY")); 1227 state_atom_list.push_back(atom_cache_.GetAtom("_NET_WM_STATE_STICKY"));
1228 ui::SetIntProperty(xwindow_, "_NET_WM_DESKTOP", "CARDINAL", kAllDesktops); 1228 ui::SetIntProperty(xwindow_, "_NET_WM_DESKTOP", "CARDINAL", kAllDesktops);
1229 } else if (params.workspace != -1) {
1230 ui::SetIntProperty(xwindow_, "_NET_WM_DESKTOP", "CARDINAL",
1231 params.workspace);
1229 } 1232 }
1230 1233
1231 // Setting _NET_WM_STATE by sending a message to the root_window (with 1234 // Setting _NET_WM_STATE by sending a message to the root_window (with
1232 // SetWMSpecState) has no effect here since the window has not yet been 1235 // SetWMSpecState) has no effect here since the window has not yet been
1233 // mapped. So we manually change the state. 1236 // mapped. So we manually change the state.
1234 if (!state_atom_list.empty()) { 1237 if (!state_atom_list.empty()) {
1235 ui::SetAtomArrayProperty(xwindow_, 1238 ui::SetAtomArrayProperty(xwindow_,
1236 "_NET_WM_STATE", 1239 "_NET_WM_STATE",
1237 "ATOM", 1240 "ATOM",
1238 state_atom_list); 1241 state_atom_list);
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
1987 ui::MouseEvent mouseev(xev); 1990 ui::MouseEvent mouseev(xev);
1988 DispatchMouseEvent(&mouseev); 1991 DispatchMouseEvent(&mouseev);
1989 break; 1992 break;
1990 } 1993 }
1991 case PropertyNotify: { 1994 case PropertyNotify: {
1992 ::Atom changed_atom = xev->xproperty.atom; 1995 ::Atom changed_atom = xev->xproperty.atom;
1993 if (changed_atom == atom_cache_.GetAtom("_NET_WM_STATE")) 1996 if (changed_atom == atom_cache_.GetAtom("_NET_WM_STATE"))
1994 OnWMStateUpdated(); 1997 OnWMStateUpdated();
1995 else if (changed_atom == atom_cache_.GetAtom("_NET_FRAME_EXTENTS")) 1998 else if (changed_atom == atom_cache_.GetAtom("_NET_FRAME_EXTENTS"))
1996 OnFrameExtentsUpdated(); 1999 OnFrameExtentsUpdated();
2000 else if (changed_atom == atom_cache_.GetAtom("_NET_WM_DESKTOP")) {
sky 2016/04/29 17:05:45 when you add {} to one branch, then add {} to all
Tom (Use chromium acct) 2016/04/29 19:14:04 Done.
2001 int workspace_id;
2002 if (ui::GetIntProperty(xwindow_, "_NET_WM_DESKTOP", &workspace_id))
2003 OnHostWorkspaceChanged(workspace_id);
2004 }
1997 break; 2005 break;
1998 } 2006 }
1999 case SelectionNotify: { 2007 case SelectionNotify: {
2000 drag_drop_client_->OnSelectionNotify(xev->xselection); 2008 drag_drop_client_->OnSelectionNotify(xev->xselection);
2001 break; 2009 break;
2002 } 2010 }
2003 } 2011 }
2004 return ui::POST_DISPATCH_STOP_PROPAGATION; 2012 return ui::POST_DISPATCH_STOP_PROPAGATION;
2005 } 2013 }
2006 2014
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
2062 if (linux_ui) { 2070 if (linux_ui) {
2063 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); 2071 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window);
2064 if (native_theme) 2072 if (native_theme)
2065 return native_theme; 2073 return native_theme;
2066 } 2074 }
2067 2075
2068 return ui::NativeThemeAura::instance(); 2076 return ui::NativeThemeAura::instance();
2069 } 2077 }
2070 2078
2071 } // namespace views 2079 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698