Commit Graph

171 Commits

Author SHA1 Message Date
Jacek Caban 10f38c0600 winex11: Move user driver to unixlib.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-06 19:18:22 +02:00
Jacek Caban 4af9ac6733 winex11: Directly use win32u in more places.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-05 18:35:12 +02:00
Jacek Caban 21d269f2fc winex11: Use unixlib interface for systray docking.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-05 18:35:08 +02:00
Jacek Caban 040d1f9bbd winex11: Introduce x11drv_client_call.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-05 18:35:07 +02:00
Jacek Caban fce3f9c323 winex11: Move x11drv_post_drop to xdnd.c.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-04 21:27:25 +02:00
Jacek Caban c736411fb8 winex11: Directly use ntdll in more places.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-03 19:01:13 +02:00
Jacek Caban e02c2f82d4 winex11: Reimplement EVENT_DropFromOffiX using get_dos_file_name.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-03 19:01:13 +02:00
Jacek Caban 30e172203d winex11: Use import_text_uri_list code in EVENT_DropURLs.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-03 19:01:13 +02:00
Jacek Caban ac9b635800 win32u: Use NT interface for MsgWaitForMultipleObjectsEx user driver entry point.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-03 19:01:13 +02:00
Jacek Caban ace09cf315 winex11: Move XdndLeave event handler to event.c.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-28 16:12:24 +02:00
Jacek Caban e510f8650e winex11: Move XdndDrop event handler to event.c.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-28 16:12:24 +02:00
Jacek Caban 1d337249f1 winex11: Move XdndPosition event handler to event.c.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-28 16:12:24 +02:00
Jacek Caban 3b06509f46 winex11: Move XdndEnter event handler to event.c.
In preparation for xdnd.c being in PE file.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-28 16:12:20 +02:00
Jacek Caban ee405dd8b8 win32u: Move is_window_rect_full_screen implementation from winex11.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-20 17:31:18 +02:00
Jacek Caban db9b7b0f51 winex11: Use TEB to store driver thread data.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-19 17:36:52 +02:00
Jacek Caban 3e94864540 winex11: Use NtUserGetThreadInfo to access thread data.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-19 17:36:41 +02:00
Jacek Caban 21c37e8f95 winex11: Directly use win32u for user functions in event.c.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-15 20:54:34 +02:00
Jacek Caban 3a11be1d48 winex11: Directly use win32u for GDI functions in more places.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-12 21:39:42 +02:00
Jacek Caban f6524f7a3a win32u: Don't use CDECL for user driver functions.
They are no longer used from PE code.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-07 22:44:39 +02:00
Jacek Caban fd675485be user32: Use user_driver_funcs to expose user driver function from drivers.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-11 18:39:48 +01:00
Huw Davies 6fdae1979b configure: Stop checking for poll.h and sys/poll.h - always use poll.h.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-31 17:56:54 +01:00
Ziqing Hui 57b1b21a84 winex11.drv: Correct a full screen condition.
The if condition here came from 47c54c4ae7,
which is to detect full screen window.

However, according to tests in previous commit, there is possibility
that a window without setting WS_CAPTION is not full screen, for example,
main window of Tencent WeChat. And windows like this can also be maximized
or restored. So that we can not treat WS_CAPTION as our full screen condition.

This fixes maximizing Tencent WeChat by dragging it to screen edge.

Signed-off-by: Ziqing Hui <zhui@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-27 16:52:30 +02:00
Rémi Bernon 4cb6334b1b winex11.drv: Don't assume that GenericEvent has a window.
It doesn't, and we then lookup HWND from an invalid Window value.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-23 22:30:31 +01:00
Zhiyi Zhang 2873527819 winex11.drv: Update a comment.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-30 10:35:12 +01:00
Rémi Bernon cfcc280905 winex11.drv: Send HTMENU instead of HTCAPTION to query window activation.
Commit 71d35d8940 broke the way
WM_TAKE_FOCUS protocol is implemented: WM_MOUSEACTIVATE now replies
MA_NOACTIVATE by default when using HTCAPTION.

We use the WM_MOUSEACTIVATE -although Windows does not- regardless of
the way focus is changed to check whether a window wants focus, and
Windows sometimes changes focus regardless of the message reply.

Steam and the Wine system tray are affected for instance.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-26 21:56:04 +01:00
Zhiyi Zhang 99d047724e winex11.drv: Introduce is_virtual_desktop().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-05 17:30:48 +01:00
Rémi Bernon ae8f605ede winex11.drv: Handle FocusIn/NotifyGrab and FocusOut/NotifyUngrab events.
These events are received on mutter, when moving undecorated managed
windows, although Wine never grabs the keyboard itself.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-23 19:44:18 +02:00
Rémi Bernon 6f9e788fc0 winex11.drv: Do not set clipping_cursor when clip window map state changes.
This flag should only indicate a successful call to XGrabPointer. If not
then we could assume we have ownership of the pointer when we don't.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-06 19:04:25 +02:00
Rémi Bernon 92177b0b16 winex11.drv: Retry last ClipCursor when grab is released.
As we ignore these NotifyGrab / NotifyUngrab w.r.t focus decisions,
some applications are unaware of mouse grabs being lost and sometimes
cursor clipping is lost. We have to keep the last clip rectangle and
restore it when grab is released.

This has been squashed with the foreground window check from
Zhiyi Zhang <zzhang@codeweavers.com> to fix an issue that happens when
switching from a fullscreen window - because there's some additional
focus events involved - but in general, if the window that is getting
focus cannot be activated:

When FocusIn/NotifyWhileGrabbed is received, SetForegroundWindow is not
called if the window cannot be activated. When the FocusIn/NotifyUngrab
event arrives for the same window, we have to check the foreground
window before restoring cursor clipping rectangle.

For reference, the event sequence when pressing Alt-Tab - for WMs that
grab the keyboard - is the following:

1. FocusOut/NotifyGrab, when WM grabs the keyboard.
2. FocusOut/NotifyWhileGrabbed, while WM switches windows, this calls
   SetForegroundWindow(GetDesktopWindow()).

The event sequence for normal windows ends here, but for fullscreen
windows, there may be these additional events:

3. FocusIn/NotifyWhileGrabbed, which may not change Wine foreground
   window if it cannot be activated.
4. FocusIn/NotifyUnGrab, when WM releases the keyboard while switching
   windows, this is ignored but it should not retry to grab the cursor,
   because window is not foreground.
5. FocusOut/NotifyNormal, when WM finishes switching the windows.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-06 19:03:59 +02:00
Rémi Bernon 54f8077c41 winex11.drv: Only grab or warp the cursor when keyboard isn't grabbed.
When the window manager has taken a keyboard grab, it may be going to
move the window itself, so the application should not move the cursor
at the same time.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-06 19:03:44 +02:00
Rémi Bernon 4b81771b00 winex11.drv: Do not react to keyboard grab focus events.
Several window managers are sending FocusOut with NotifyGrab mode
then FocusOut with NotifyWhileGrabbed mode when a window focus is lost,
as a consequence of grabbing the keyboard input before changing window
focus.

This is the case during alt-tab, but keyboard can also be grabbed when
bringing activity view or clicking on the title bar. In this cases
NotifyWhileGrabbed events aren't sent until the window really loses
foreground.

In the same manner, when focus is restored, they usually send FocusIn
with NotifyWhileGrabbed mode followed by FocusIn with NotifyUngrab mode
when the keyboard grab is released.

When bringing activity view back and forth, or clicking on the title
bar, only NotifyUngrab event will be sent.

In order to be consistent across WM and to help simplifying focus
handling, just ignore focus events related to keyboard grabs.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-06 19:00:17 +02:00
Rémi Bernon de6450135d winex11.drv: Print the FocusIn/FocusOut mode in trace message.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-13 12:49:09 +02:00
Zhiyi Zhang 82c6ec3a32 winex11.drv: Activate window when restoring from iconic state.
Some games, e.g., Project CARS waits for WM_ACTIVATE
when restoring from iconic state.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-10 19:42:38 +02:00
Michael Stefaniuc 8e1d40b966 winex11.drv: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-19 23:17:49 +02:00
Alexandre Julliard dc6f39ac29 server: Use screen coordinates in the update_window_zorder request.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-27 15:16:45 +02:00
Alexandre Julliard d7cd441373 winex11: Use the stored coordinates to convert back from X11 to window rectangle.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-23 10:54:00 +02:00
Andrew Eikum 18564c76fc winex11.drv: Fix indentation for focus_out.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-22 22:59:54 +02:00
Andrey Gusev d09c4d9116 winex11.drv: Move condition to the proper place.
Signed-off-by: Andrey Gusev <andrey.goosev@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-22 12:44:48 +02:00
Akihiro Sagawa 876d5de0b4 winex11: Use proper return type for process_events().
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-29 16:39:33 +09:00
Akihiro Sagawa 030e1f4f5f winex11: Fix log message in process_events().
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-29 16:39:29 +09:00
Akihiro Sagawa ce7a98e95c winex11: Return more reliable value from X11DRV_MsgWaitForMultipleObjects.
After processing several X events, X11DRV_MsgWaitForMultipleObjects always
tells us that a new message is available. This is not true for some cases.

For instance, when we call DestroyWindow, the X queues DestroyEvent. Then,
X11DRV_MsgWaitForMultipleObjects handles the event only; none is posted or
sent as hwnd for destroyed window is unavailable. However, the function
states "new message is available" by returning count - 1 value.

This is an issue for CoWaitForMultipleHandles because it expects a new
message in the queue and consumes the message.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-25 22:27:40 +09:00
Alexandre Julliard 197f708be4 winex11: Include raw motion events in the QS_MOUSEMOVE event filter.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-12-02 15:31:34 +09:00
Vincent Povirk 3d8353fe18 winex11.drv: Track external changes to _NET_WM_STATE in net_wm_state.
In some cases, WM's will modify the _NET_WM_STATE of our own windows.
Most notably, this can happen when the WM maximizes our window, but
mutter has been known to alter the fullscreen state as well. If we
want to reconfigure our window later, we'll probably have to remove
these states, which means we need to remember that they were set.
2015-07-02 20:38:54 +09:00
Francois Gouget 3adc91f3fc winex11.drv: Remove unneeded NONAMELESSXXX directives. 2015-04-01 14:13:09 +09:00
Piotr Caban e7cba8f0dc winex11.drv: Don't resize hidden windows on ConfigureNotify event. 2015-01-08 13:58:29 +01:00
Sebastian Lackner f3568a5e12 winex11: Catch invalid values from broken QX11EmbedContainer implementations. 2014-01-27 14:13:29 +01:00
Frédéric Delanoy 323bec99b3 winex11.drv: Use BOOL type where appropriate. 2013-11-29 13:32:46 +01:00
Sebastian Lackner 2e0ca3e746 winex11: Send XEMBED_REQUEST_FOCUS request for embedded windows. 2013-11-19 19:03:40 +01:00
Sebastian Lackner df6dc091e6 winex11: Implement additional XEMBED events. 2013-11-11 20:06:56 +01:00
Alexandre Julliard 0b71e0bf12 winex11: Add helper functions for converting between root and virtual screen coords. 2013-10-14 17:26:13 +02:00