Commit Graph

383 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 2c1b7c8c17 winex11: Move LoadIcon call to dllmain.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-06 19:18:18 +02:00
Jacek Caban 0dcd1eaae5 winex11: Directly use NtUserCreateWindowEx.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-06 19:18:18 +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 7256519102 winex11: Move foreign_window_proc to systray.c.
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 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 e41630612b winex11: Use unixlib interface for X11 calls from systray.c.
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 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 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 c0a8b2dbd5 winex11: Use ntdll_umbstowcs and ntdll_wcstoumbs for Unicode conversion.
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 bd721f0371 winex11: Directly use ntdll for utf8 conversion.
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 aa9072998f winex11: Use inline intersect_rect helper instead of IntersectRect.
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 ef8e4b7e3e winex11: Use libc for driver memory allocation.
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-25 20:34:55 +02:00
Paul Gofman 3eb944c0a7 winex11.drv: Treat invalid icon as no icon in fetch_icon_data().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-25 12:33:31 +02:00
Jacek Caban c5e7f1b0e5 winex11: Use Unix environment variable in remove_startup_notification.
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:21 +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 2906275967 winex11: Use build_hwnd_list for X11DRV_DisplayDevices_Update implementation.
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:35:44 +02:00
Jacek Caban 2425488ef6 winex11: Use NtUserBuildHwndList for has_owned_popup implementation.
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:35:38 +02:00
Jacek Caban fd83308b0b winex11: Use pthread for win data locking.
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-18 20:59:12 +02:00
Jacek Caban 262831bc63 winex11: Directly use win32u 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-15 20:54:36 +02:00
Jacek Caban 55f4cf8c85 winex11: Directly use win32u for user functions in window.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-13 18:13:38 +02:00
Jacek Caban 523a6eba02 winex11: Remove no longer needed helpers.
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-13 18:13:34 +02:00
Jacek Caban df4ddc30b3 winex11: Directly use win32u for GDI functions in window.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-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
Gabriel Ivăncescu a22dd45a79 winex11.drv: Map the window in UpdateLayeredWindow.
Fixes a regression introduced by 8892b79118,
because set_window_pos is called before UpdateLayeredWindow, which calls
the driver's WindowPosChanged earlier.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51984
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-28 18:55:51 +01:00
Alexandre Julliard 13ec7952e0 configure: Assume that unistd.h is available on Unix.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-09 18:43:51 +01:00
Alexandre Julliard 8d6c33c3bf include: Remove wine/port.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:54 +01:00
Zhiyi Zhang 1c1fe30cc5 explorerframe: Implement taskbar_list_AddTab() for x11 driver.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-25 21:19:46 +01:00
Zhiyi Zhang d9b1df267a explorerframe: Implement taskbar_list_DeleteTab() for x11 driver.
Partially fix Excel 2007 and 2010 showing an extra taskbar icon when
opening multiple documents in one instance.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-25 21:19:46 +01:00
Rémi Bernon da11387857 winex11.drv: Use XIValuatorClassInfo instead of a custom struct.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-25 20:55:00 +02:00
Paul Gofman 6dcaff421f winex11.drv: Detach vulkan surfaces during thread detach.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-18 17:06:45 +02:00
Alexandre Julliard c1b3d6eb10 ntdll: Add a __wine_unix_spawnvp syscall.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-27 17:40:14 +02:00
Zhiyi Zhang 211da181c9 winex11.drv: Always add MWM_FUNC_CLOSE to enabled windows.
Some window managers require MWM_FUNC_CLOSE to be present for a window to be allowed to close. For
example, on KWin, a window of style WS_POPUP | WS_VISIBLE has a close button drawn on top of its
taskbar preview. But when you press it, the window manager refuses to close it. On Mutter, windows
without MWN_FUNC_CLOSE doesn't have a close button on the window preview. On Windows 10, enabled
windows without WS_SYSMENU always has a close button on their taskbar window preview and can always
be closed with the close button. On Windows 7, enabled windows without WS_SYSMENU has no close
button on the window preview but still can be closed with the right-click menu on the taskbar.
This patch changes the behavior to match that of Windows 10.

Fix WeChat image preview window cannot be closed from KDE panels.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-31 21:06:25 +02:00
Rémi Bernon 454712a94d user32: Add a default WindowPosChanging implementation.
Which creates an off-screen window surface for top-level non-layered or
SLWA-layered windows.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-20 21:48:57 +02:00
Rémi Bernon 07b9f3f609 user32: Factor IsRectEmpty driver check in ShowWindow.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-17 20:37:04 +02:00
Paul Gofman 011fabb2c4 winex11.drv: Handle Vulkan surface creation with NULL hwnd.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 21:05:31 +02:00
Alexandre Julliard b79211efec winex11: Don't delay mapping 0-sized layered windows.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49575
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-04 13:56:58 +01:00
Gabriel Ivăncescu 688fe7068c winex11.drv: Always enable minimize/maximize functions for minimized windows.
A window without a minimize or maximize box can still be programmatically
minimized by the Windows API. However, some WMs will refuse to change the
state and not allow it to be maximized again, despite it being minimized,
due to lacking those functions, thus not sending WM_STATE change notifications
when clicking the minimized window on the taskbar.

Heroes of Might and Magic V does this, for example, when losing focus. It
minimizes itself. When maximizing it by clicking on the taskbar it won't
send a WM_STATE change notification (since it was never changed) and fail
to maximize properly, showing a black screen (the game will still think it
is minimized).

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-01 13:41:53 +01:00
Alexandre Julliard c7196dc945 libport: Move the case mapping table back to libwine and stop updating it.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-30 19:01:55 +01:00
Rémi Bernon 16984895f0 winex11.drv: Forward clip_fullscreen_window to foreground thread.
If the current thread isn't the foreground thread. Otherwise we may
clip the cursor in the wrong thread, that isn't expecting mouse messages
or may not be checking its messages.

Red Faction has some race condition where this can happen for instance,
with clip_fullscreen_window called from X11DRV_DisplayDevices_Update
callback in a background thread. This thread starts clipping the cursor,
and the foreground thread isn't receiving MotionNotify events anymore.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-05 22:00:56 +02:00
Rémi Bernon 0120a1aa40 winex11.drv: Split clip cursor message in notify/request.
The message was sent to two different types of windows, with a different
semantic. We can now add parameters to the request without changing the
notify parameters semantics.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-05 22:00:53 +02:00
Zhiyi Zhang d9625e5a01 winex11.drv: Support clipping full screen windows on non-primary monitors.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-26 11:09:13 +02:00
Zhiyi Zhang 715a04daab winex11.drv: Support full screen windows on non-primary monitors.
A window can be maximized or full screen on non-primary monitors. In this
case we need to add _NET_WM_STATE_MAXIMIZED or _NET_WM_STATE_FULLSCREEN
hint to the window so that they can be handled correctly by window managers.
For example, a full screen window on the secondary monitor needs
_NET_WM_STATE_FULLSCREEN so that window managers prevent panels from obscuring it.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-26 11:09:10 +02:00
Zhiyi Zhang c5ec1585f6 winex11.drv: Always update _NET_WM_STATE in update_net_wm_states().
KWin treats a window covering exactly the whole monitor as maximized
when handling its first map request and expects applications to update
maximized state later. Wine doesn't know about this added maximized
state and expect it unchanged, making the window always maximized
as far as KWin is concerned. So always send _NET_WM_STATE updates
even if Wine doesn't expect changes to hint KWin that a window should
not be maximized.

Fix test failures when running the tests introduced by
36b720357b with KWin.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-26 11:09:05 +02:00
Piotr Caban 5bb4e4b36c user32: Support undocumented SC_SIZE flag that can be used to move window.
Fixes main window moving in Quicken 2020.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-30 16:33:22 +02:00
Gabriel Ivăncescu fff3642747 winex11.drv: Fix X11DRV_X_to_window_rect to handle windows smaller than the decoration.
A window can be resized to a smaller size than the decoration (title +
borders), such as when it is minimized. In such cases it is necessary
to recompute the minimum bounds, as it is done in the opposite function
X11DRV_window_to_X_rect, since the real information was lost.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48490
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-20 20:52:26 +02:00
Gabriel Ivăncescu df0d8ac5be winex11.drv: Use a helper to retrieve the decoration rect for managed windows.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-20 20:52:21 +02:00
Zhiyi Zhang 26b26a2e0e winex11.drv: Move update_windows_on_desktop_resize().
Move update_windows_on_desktop_resize() to be in X11DRV_DisplayDevices_Update()
and rename it to update_windows_on_display_change(), which is a more appropriate
name because the desktop is unnecessarily resized when display devices change.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-12 23:10:22 +02:00
Zhiyi Zhang fd6f50c0d3 winex11.drv: Resize desktop upon display change events.
Otherwise, Wine still has the old desktop size after a user changed
display resolution using host system utilities.

X11DRV_DisplayDevices_Update() is introduced so that display devices
reinitialization is separated from desktop resizing. Otherwise,
X11DRV_DisplayDevices_Init() would have to be called twice to resize
the desktop with up-to-date primary monitor dimensions, wasting resources.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48441
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-12 23:10:18 +02:00
Zhiyi Zhang c69bb0342c winex11.drv: Update _NET_WM_STATE before resizing windows.
According to the Extended Window Manager Hints (EWMH) spec 1.3 regarding
_NET_WM_STATE_FULLSCREEN, "the Window Manager is responsible for
restoring the original geometry after a switch from fullscreen back to
normal window.", which means that removing _NET_WM_STATE_FULLSCREEN from
a window may cause the window to receive a ConfigureNotify event to
restore the window size, thus causing a application resize action to be
overwritten by the window managers.

Fix a game called Mugsters becomes maximized after exiting full screen.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-07 20:13:16 +02:00