Make all windows moveable by default
Dmitry Timoshkov
dmitry at codeweavers.com
Thu Oct 5 09:16:36 CDT 2006
Hello,
an app I'm working on creates a top level window without a caption,
and returns HTCAPTION on WM_NCHITTEST to make the window moveable by
dragging its client area. The app's window currently is not moveable
under Wine because we don't set MWM_FUNC_MOVE WM hint for captionless
windows. This patch makes my app's main window moveable.
Changelog:
Make all windows moveable by default.
diff -up cvs/hq/wine/dlls/winex11.drv/window.c wine/dlls/winex11.drv/window.c
--- cvs/hq/wine/dlls/winex11.drv/window.c 2006-08-25 13:23:18.000000000 +0900
+++ wine/dlls/winex11.drv/window.c 2006-10-05 23:01:14.000000000 +0900
@@ -532,13 +532,11 @@ void X11DRV_set_wm_hints( Display *displ
}
mwm_hints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS;
- mwm_hints.functions = 0;
- if ((style & WS_CAPTION) == WS_CAPTION) mwm_hints.functions |= MWM_FUNC_MOVE;
- if (style & WS_THICKFRAME) mwm_hints.functions |= MWM_FUNC_MOVE | MWM_FUNC_RESIZE;
+ mwm_hints.functions = MWM_FUNC_MOVE;
+ if (style & WS_THICKFRAME) mwm_hints.functions |= MWM_FUNC_RESIZE;
if (style & WS_MINIMIZEBOX) mwm_hints.functions |= MWM_FUNC_MINIMIZE;
if (style & WS_MAXIMIZEBOX) mwm_hints.functions |= MWM_FUNC_MAXIMIZE;
if (style & WS_SYSMENU) mwm_hints.functions |= MWM_FUNC_CLOSE;
- if (ex_style & WS_EX_APPWINDOW) mwm_hints.functions |= MWM_FUNC_MOVE;
mwm_hints.decorations = 0;
if ((style & WS_CAPTION) == WS_CAPTION)
{
diff -up cvs/hq/wine/dlls/winex11.drv/winpos.c wine/dlls/winex11.drv/winpos.c
--- cvs/hq/wine/dlls/winex11.drv/winpos.c 2006-07-03 15:48:29.000000000 +0900
+++ wine/dlls/winex11.drv/winpos.c 2006-10-05 22:58:11.000000000 +0900
@@ -1537,6 +1537,8 @@ static void X11DRV_WMMoveResizeWindow( H
XEvent xev;
Display *display = thread_display();
+ TRACE("hwnd %p, x %d, y %d, dir %d\n", hwnd, x, y, dir);
+
xev.xclient.type = ClientMessage;
xev.xclient.window = X11DRV_get_whole_window(hwnd);
xev.xclient.message_type = x11drv_atom(_NET_WM_MOVERESIZE);
@@ -1594,6 +1596,9 @@ void X11DRV_SysCommandSizeMove( HWND hwn
if (!(data = X11DRV_get_win_data( hwnd ))) return;
+ TRACE("hwnd %p (%smanaged), command %04x, hittest %ld, pos %ld,%ld\n",
+ hwnd, data->managed ? "" : "NOT ", syscommand, hittest, pt.x, pt.y);
+
/* if we are managed then we let the WM do all the work */
if (data->managed)
{
More information about the wine-patches
mailing list