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

Unified Diff: ui/base/x/x11_util.cc

Issue 2410773002: Linux Aura: Use managed tab dragging when possible (Reland)
Patch Set: use POST_DISPATCH_NONE Created 4 years, 2 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
« no previous file with comments | « ui/base/x/x11_util.h ('k') | ui/views/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/x/x11_util.cc
diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc
index ec6b5363d72403d266c487e9e625a49ff7751e1d..31a6eed6c1b5339304227b311e084ccc72d21a06 100644
--- a/ui/base/x/x11_util.cc
+++ b/ui/base/x/x11_util.cc
@@ -495,6 +495,30 @@ void SetUseOSWindowFrame(XID window, bool use_os_window_frame) {
sizeof(MotifWmHints)/sizeof(long));
}
+void MoveResizeManagedWindow(XID window,
+ gfx::Point root_location,
+ NetWmMoveResize mode) {
+ XDisplay* display = gfx::GetXDisplay();
+ XAtom message_type = GetAtom("_NET_WM_MOVERESIZE");
+ XEvent event;
+ memset(&event, 0, sizeof(event));
+ event.xclient.type = ClientMessage;
+ event.xclient.display = display;
+ event.xclient.window = window;
+ event.xclient.message_type = message_type;
+ event.xclient.format = 32;
+ event.xclient.data.l[0] = root_location.x();
+ event.xclient.data.l[1] = root_location.y();
+ event.xclient.data.l[2] = static_cast<long>(mode);
+ event.xclient.data.l[3] =
+ Button1; // Currently all our managed dragging is done with LMB.
+ event.xclient.data.l[4] = 1; // Requested by normal application
+
+ XSendEvent(display, DefaultRootWindow(display), False,
+ SubstructureRedirectMask | SubstructureNotifyMask, &event);
+ XFlush(display);
+}
+
bool IsShapeExtensionAvailable() {
int dummy;
static bool is_shape_available =
« no previous file with comments | « ui/base/x/x11_util.h ('k') | ui/views/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698