summaryrefslogtreecommitdiffstats
path: root/chrome/common/x11_util.h
diff options
context:
space:
mode:
authorderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-30 00:48:16 +0000
committerderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-30 00:48:16 +0000
commit4d023b86e67eea53d3a07dda4a516a1e74eeb69d (patch)
treeaab34aa24c601d55c2d52df1704e887d853b12b2 /chrome/common/x11_util.h
parent2d4f7dd2730272ae457e5ef10449a747fdd96a84 (diff)
downloadchromium_src-4d023b86e67eea53d3a07dda4a516a1e74eeb69d.zip
chromium_src-4d023b86e67eea53d3a07dda4a516a1e74eeb69d.tar.gz
chromium_src-4d023b86e67eea53d3a07dda4a516a1e74eeb69d.tar.bz2
Linux: Make InfoBubble use an override-redirect (popup) window.
This makes it work correctly in ion3 and other window managers that don't expect clients to try to move top-level windows themselves. This implementation grabs the pointer and keyboard. By doing this and using an override-redirect window, we should be able to avoid worrying about interactions with different window managers. The only downside (alluded to in the previous code) is that window manager keybindings don't make it through until the user dismisses the bubble by clicking outside of it or hitting Enter or Escape. I don't think this will be a problem; it's no different from what happens when you open a context menu in an app. BUG=20523 TEST=tested first-run and bookmark bubbles in Metacity, ion3, Fluxbox, KDE4, and the WM that I'm working on Review URL: http://codereview.chromium.org/198016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27578 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/x11_util.h')
-rw-r--r--chrome/common/x11_util.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome/common/x11_util.h b/chrome/common/x11_util.h
index a3dbb2a..f11739c 100644
--- a/chrome/common/x11_util.h
+++ b/chrome/common/x11_util.h
@@ -70,6 +70,12 @@ bool GetIntProperty(XID window, const std::string& property_name, int* value);
bool GetStringProperty(
XID window, const std::string& property_name, std::string* value);
+// Get |window|'s parent window, or None if |window| is the root window.
+XID GetParentWindow(XID window);
+
+// Walk up |window|'s hierarchy until we find a direct child of |root|.
+XID GetHighestAncestorWindow(XID window, XID root);
+
// Implementers of this interface receive a notification for every X window of
// the main display.
class EnumerateWindowsDelegate {
@@ -86,6 +92,12 @@ bool EnumerateAllWindows(EnumerateWindowsDelegate* delegate, int max_depth);
// Returns a list of top-level windows in top-to-bottom stacking order.
bool GetXWindowStack(std::vector<XID>* windows);
+// Restack a window in relation to one of its siblings. If |above| is true,
+// |window| will be stacked directly above |sibling|; otherwise it will stacked
+// directly below it. Both windows must be immediate children of the same
+// window.
+void RestackWindow(XID window, XID sibling, bool above);
+
// Return a handle to a server side pixmap. |shared_memory_key| is a SysV
// IPC key. The shared memory region must contain 32-bit pixels.
XID AttachSharedMemory(Display* display, int shared_memory_support);