When we are clipping (due to fullscreen), certain operations are bugged (such as creating another window on top, grabbing the window during a size-move operation, changing mouse capture, etc) so we must temporarily unclip first.
Seems unclipping it temporarily during such operation is enough to fix this.
This probably wasn't very obvious in practice because most times "fullscreen" means a single non-resizeable window with no menus and so on (e.g. fullscreen games), but that's not always the case.
-- v4: win32u: Don't clip fullscreen windows while capturing mouse pointer. winex11: Don't clip while creating X Window.
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53831 Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/winex11.drv/window.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 974bd376fe6..f24630c57f5 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1613,6 +1613,7 @@ static void create_whole_window( struct x11drv_win_data *data ) WCHAR text[1024]; COLORREF key; BYTE alpha; + BOOL was_clipped = FALSE; DWORD layered_flags; HRGN win_rgn; POINT pos; @@ -1641,10 +1642,21 @@ static void create_whole_window( struct x11drv_win_data *data ) if (!(cy = data->whole_rect.bottom - data->whole_rect.top)) cy = 1; else if (cy > 65535) cy = 65535;
+ /* unclip it while we create the Window, see Wine-Bug 53831 */ + if (x11drv_thread_data() && x11drv_thread_data()->clipping_cursor) + { + was_clipped = TRUE; + ungrab_clipping_window(); + } pos = virtual_screen_to_root( data->whole_rect.left, data->whole_rect.top ); data->whole_window = XCreateWindow( data->display, root_window, pos.x, pos.y, cx, cy, 0, data->vis.depth, InputOutput, data->vis.visual, mask, &attr ); + if (was_clipped) + { + clipping_cursor = TRUE; + retry_grab_clipping_window(); + } if (!data->whole_window) goto done;
set_initial_wm_hints( data->display, data->whole_window );
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53831 Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/win32u/input.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 205b792d784..66eba38cc4b 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2485,6 +2485,7 @@ BOOL clip_fullscreen_window( HWND hwnd, BOOL reset )
if (!NtUserGetWindowRect( hwnd, &rect )) return FALSE; if (!NtUserIsWindowRectFullScreen( &rect )) return FALSE; + if (get_capture()) return FALSE; if (NtGetTickCount() - thread_info->clipping_reset < 1000) return FALSE; if (!reset && clipping_cursor && thread_info->clipping_cursor) return FALSE; /* already clipping */
I tried REAPER and I couldn't reproduce any of the issues described under GNOME/mutter. Maybe that's WM specific? Which WM are you using?
Although the change with `clip_fullscreen_window` and `set_capture` is probably fine I also don't see SetCapture being called, is there any specific steps to follow to trigger that?
On Thu Jun 22 13:03:17 2023 +0000, Rémi Bernon wrote:
I tried REAPER and I couldn't reproduce any of the issues described under GNOME/mutter. Maybe that's WM specific? Which WM are you using? Although the change with `clip_fullscreen_window` and `set_capture` is probably fine I also don't see SetCapture being called, is there any specific steps to follow to trigger that?
I see, I am using Compiz (yeah, I know it might have a bug with it, not entirely sure).
SetCapture is needed when you spawn another window, such as the Project Settings or the Render window (from the File menu), then try to drag that window for example. It won't allow me to drag it here without the SetCapture change.
Of course all of this has to be done while the main window is fullscreen and clipping.
On Thu Jun 22 13:03:17 2023 +0000, Gabriel Ivăncescu wrote:
I see, I am using Compiz (yeah, I know it might have a bug with it, not entirely sure). SetCapture is needed when you spawn another window, such as the Project Settings or the Render window (from the File menu), then try to drag that window for example. It won't allow me to drag it here without the SetCapture change. Of course all of this has to be done while the main window is fullscreen and clipping.
Fwiw I think disabling / enabling cursor clipping when creating a window is not great. I don't think it should be necessary and it seems brittle at best.
Then I'd approve the check for a capture window when trying to enable fullscreen clipping alone.
And if we want to help working around bogus WMs, like it seems to be here, maybe it would be better to change the fullscreen clipping option to either:
* Disable fullscreen clipping entirely if the option is not selected.
* Make it a three state option (on/off/auto), and keep the current behavior as the "auto" setting.
On Wed Jul 5 08:41:22 2023 +0000, Rémi Bernon wrote:
Fwiw I think disabling / enabling cursor clipping when creating a window is not great. I don't think it should be necessary and it seems brittle at best. Then I'd approve the check for a capture window when trying to enable fullscreen clipping alone. And if we want to help working around bogus WMs, like it seems to be here, maybe it would be better to change the fullscreen clipping option to either:
- Disable fullscreen clipping entirely if the option is not selected.
- Make it a three state option (on/off/auto), and keep the current
behavior as the "auto" setting.
Ok I'll send one with just the win32u change. I didn't even know there was a fullscreen clip option, guess I'll just use that. :-)