If an application in its IDropTarget::Drop() implementation saves the passed in
IDataObject and later calls IDataObject::GetData() it fails because global cached
data is no longer available. Another solution is to create a copy of global data
and save it inside of IDataObject, but since all data including item contents is
global anyway this doesn't seem worth the trouble. Global cahed data will be freed
in next X11DRV_XDND_EnterEvent().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
The keyboard layout matching algorithm can assign a negative score
to a keyboard layout. If the user has a strange keyboard layout,
possibly a custom one, it might happen that all keyboard layouts
known by Wine get a negative score. This is not an error in itself,
and we should still strive to find the best match.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
The err_callback* globals need to be protected from being overwritten
before X11DRV_check_error is called, otherwise no or the wrong error
handler might be called.
Signed-off-by: Torge Matthies <openglfreak@googlemail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
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>
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>
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>
Add the ability to check if the pixel format on the current window was
previously set by wglSetPixelFormatWine(), and if was, allow the
application to change it with a regular wglSetPixelFormat call.
Signed-off-by: Connor McAdams <cmcadams@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
And send_hardware_message.
This makes it possible to use __wine_send_input to send extended input
data, such as HID device notifications and WM_INPUT messages carrying
HID reports.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Since whole_rect / client_rect are updated asynchronously, there may be
a small lag between X11 and Wine regarding the expected window position.
Then, as events' x and y fields are reported relative to the X11 window
position, this lag can cause inconsistencies when we compute absolute
mouse positions.
Also, applications that control their own position while being moved
cause additional whole_rect / client_rect updates, before X11 knows
about it.
This can make applications like Winamp go nuts when they are being moved
and move all over the place "randomly".
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46309
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Based on a patch from Gabriel Ivăncescu <gabrielopcode@gmail.com>.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46309
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
We already converted coordinates from root to virtual screen, we
shouldn't need to remap them.
This is actually no-op because when window == root_window, hwnd is
the desktop window. In which case it isn't RTL, and MapWindowPoints is
no-op too.
It makes things less confusing and it will help later cases when we get
root-relative coordinates for other windows.
Based on a patch from Gabriel Ivăncescu <gabrielopcode@gmail.com>.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46309
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Based on a patch from Gabriel Ivăncescu <gabrielopcode@gmail.com>.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46309
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Based on a patch from Gabriel Ivăncescu <gabrielopcode@gmail.com>.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46309
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
request_selection_contents() checks whether the XFixes extension is available and will start a timer
to check for clipboard content updates at an interval. Running request_selection_contents() before
the XFixes extension is initialized will always start a timer and sends unnecessary clipboard
content change notifications, causing Office right-click menus to disappear.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Invalid read of size 8
at 0x559B816: get_work_area (display.c:296)
by 0x55DC8C1: query_screens (xinerama.c:103)
by 0x55DC8C1: xinerama_init (xinerama.c:275)
by 0x55D6F47: process_attach (x11drv_main.c:602)
by 0x55D6F47: DllMain (x11drv_main.c:721)
by 0x7BC35819: call_dll_entry_point (loader.c:285)
by 0x7BC35819: MODULE_InitDLL (loader.c:1317)
by 0x7BC362ED: process_attach.part.0 (loader.c:1411)
by 0x7BC3B843: process_attach (loader.c:1382)
by 0x7BC3B843: LdrLoadDll (loader.c:2765)
by 0x7B025C85: load_library (loader.c:172)
by 0x7B026B72: LoadLibraryExW (loader.c:522)
by 0x7B026BE5: LoadLibraryW (loader.c:492)
by 0x40990D: load_graphics_driver (desktop.c:844)
by 0x40990D: manage_desktop (desktop.c:1010)
by 0x40C6B3: parse_command_line (explorer.c:836)
by 0x40C6B3: wWinMain (explorer.c:865)
by 0x4103F2: wmain (crt_wwinmain.c:55)
Address 0x5272370 is 16 bytes before an unallocated block of size 3,132,512 in arena "client"
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Fixes Ancient Cities' black screen on Nvidia.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
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>
On headless systems, Wine can still run through a VNC connection even though no outputs are
connected. Fallback to using the Xinerama display device handler in this case to report at least
one monitor.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49500
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
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>
A display settings handler with a priority of 0 can not be properly registered due to how
X11DRV_Settings_SetHandler() is implemented. Fix a regression introduced by 9c99d9bceb.
Spotted by Torge Matthies.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50135
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>