Commit Graph

369 Commits

Author SHA1 Message Date
Alexandre Julliard 458e0ad513 winex11: Use the default color table for window surfaces on 8bpp displays.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48088
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-19 18:38:22 +01:00
Zhiyi Zhang acf03ed9da winex11.drv: Get virtual desktop size limit from the host primary display.
After 25167fb286, get_primary_monitor_rect()
maybe invalid before display device initialization or returns the desktop
rectangle after desktop initialization in virtual desktop mode, which is
wrong. The desktop size limit should come from host system.

This fixes a regression from efbbe66669.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47815
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-05 17:30:53 +01:00
Zhiyi Zhang 914b5519b1 winex11.drv: Use a separate virtual desktop display device handler.
If we want to query host monitor dimensions, we need to use XRandR
or Xinerama handler. However when in virtual desktop mode, its display
device handler overrides other handlers. So we need to separate them.
Then we can implement features that require host monitor dimensions like
checking whether the virtual desktop window is fullscreen.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-05 17:30:50 +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
Zhiyi Zhang 413aad3913 winex11.drv: Handle display device events in the desktop thread.
This fixes a regression from 22795243b2,
which calls thread_init_display() and eventually XOpenIM() before
X11DRV_InitXIM() is called.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47821
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-01 17:13:40 +01:00
Zhiyi Zhang de94cfa775 winex11.drv: Use underscore style for struct x11drv_display_device_handler.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-31 19:30:10 +01:00
Zhiyi Zhang 644d00d540 winex11.drv: Implement X11DRV_D3DKMTCheckVidPnExclusiveOwnership.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-22 23:04:27 +02:00
Zhiyi Zhang e08dd25f32 winex11.drv: Implement X11DRV_D3DKMTSetVidPnSourceOwner.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-22 23:04:27 +02:00
Zhiyi Zhang be54adcffc winex11.drv: Support XRandR display device handler.
XRandR supports multiple GPUs and runtime device change
compared to Xinerama.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-23 19:44:18 +02:00
Zebediah Figura 22993aff94 winex11: Track the client colormap separately.
If a window with an OpenGL surface attached is reparented as a child window,
and then reparented as a top-level window, so that its whole window is
destroyed and then recreated, it will be recreated with the colormap of its
child window, which more than likely has a different visual. This violates
the X11 specification, which states that a window's colormap must have the
same visual as the window itself, and causes the X server to return BadMatch
to the CreateWindow request.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-19 12:56:59 +02:00
Rémi Bernon 12c09051b4 winex11.drv: Destroy old clipping message window if it has been replaced.
When the same thread repeatedly calls ClipCursor, a message window is
created for every call, then stored in x11drv_thread_data->clip_hwnd.

The WM_X11DRV_CLIP_CURSOR notification is then sent to the desktop
window, then to the previous clipping thread in order for it to destroy
its clip_hwnd. But as the clipping thread is the same, and because
x11drv_thread_data->clip_hwnd has been overwritten, it does not satisfy
the "hwnd == data->clip_hwnd" condition and the window leaked.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-17 18:53:36 +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
Alexandre Julliard 4a902de213 gdi32: Make GDI driver functions cdecl.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-06 21:47:58 +02:00
Zhiyi Zhang 23b28323cb winex11.drv: Use generic GetMonitorInfo.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-25 13:22:17 +02:00
Zhiyi Zhang 074abfe097 winex11.drv: Use generic EnumDisplayMonitors.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-25 13:22:17 +02:00
Zhiyi Zhang 7f57cda707 winex11.drv: Handle display device changes.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-13 08:21:00 +02:00
Zhiyi Zhang 31445c3264 winex11.drv: Initialize monitor registry data.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-13 08:21:00 +02:00
Zhiyi Zhang eada617881 winex11.drv: Initialize adapter registry data.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-13 08:20:01 +02:00
Zhiyi Zhang bada31698f winex11.drv: Initialize GPU registry data.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-13 08:16:33 +02:00
Zhiyi Zhang 52a3d5db48 winex11.drv: Add Xinerama display device handler.
Display device handlers are used to initialize the display device
registry data. Different handlers can be implemented according to
the defined interface, for example, via Xinerama or XRandR.
With those registry data, EnumDisplayDevices, EnumDisplayMonitors
and GetMonitorInfo can be built on top of it.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-13 08:09:55 +02:00
Micah N Gorrell 0cb79db12a winex11.drv: Recreate gl_drawable for top-level windows as non-top level when clipping for child windows is required.
Prevent creating a gl_drawable for a window as type DC_GL_WINDOW if
there are known children of the window, since DC_GL_WINDOW does not
support clipping.

Recreate a gl_drawable that was previously create as type DC_GL_WINDOW
when a child is encountered.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=15232
Signed-off-by: Micah N Gorrell <mgorrell@codeweavers.com>
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-11 19:44:26 +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 f74e8a2967 winex11.drv: Refcount the vulkan surface window.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-14 09:31:06 +02:00
Józef Kucia 913160d2a4 winex11: Introduce GAMMA_RAMP_SIZE.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-28 11:01:24 +02:00
Henri Verbeet 14ec499d5b winex11: Restore the X11DRV_FLUSH_GL_DRAWABLE XFlush() for setups without OML_sync_control.
This was removed in e75bc6228e, but appears to
mitigate lack of OML_sync_control in at least some setups.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-16 16:40:32 +01:00
Roderick Colenbrander 6a5c85564c winex11: Add Vulkan stubs.
Signed-off-by: Roderick Colenbrander <thunderbird2k@gmail.com>
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-27 12:47:17 +01:00
Alexandre Julliard 1ce36987eb winex11: Use the client window support also for XComposite child windows.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-12 15:49:23 +01:00
Alexandre Julliard 99041a6fd3 winex11: Store only the pixmap size instead of the window rectangle in the GL drawable.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-09 13:10:25 +01:00
Alexandre Julliard e40ff92e7c winex11: Support using an ARGB visual as default visual.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-26 13:39:03 +01:00
Rafał Harabień 5c2526a086 winex11.drv: Preserve last error in x11drv_thread_data().
Signed-off-by: Rafał Harabień <rafalh1992@o2.pl>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-17 17:44:05 +01:00
Alexandre Julliard fc21a83a91 winex11: Store the process name at startup to avoid grabbing the loader lock again.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-17 22:12:08 +02:00
Carlos Garnacho 448433ae03 winex11: Use XIAllDevices to select for XI_RawMotion.
Instead of selecting for XI2 events for every slave device individually,
do it for XIAllDevices, and store the current device's relative X/Y
valuators so they can be quickly looked up in the XI_RawMotion events
received.

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-09 13:16:29 +01:00
Alexandre Julliard 89f2dafe50 winex11: Export the TIMESTAMP clipboard property.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-28 23:17:16 +09:00
Alexandre Julliard 0aa7d402d2 winex11: Remove support for exporting the CF_OEMTEXT and CF_LOCALE formats.
They can be synthesized from CF_UNICODETEXT.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-27 21:43:25 +09:00
Alexandre Julliard c837adf38e winex11: Remove support for exporting the CF_BITMAP, CF_PALETTE and CF_DIBV5 formats.
They can be synthesized from CF_DIB.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-27 21:43:25 +09:00
Alexandre Julliard 29fc759d52 winex11: Remove support for exporting the CF_METAFILEPICT format.
It can be synthesized from CF_ENHMETAFILE.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-27 21:43:25 +09:00
Alexandre Julliard 82dfbba5c6 winex11: Remove support for owner-displayed clipboard formats.
It cannot work across prefixes, and it didn't work previously either.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-27 21:43:25 +09:00
Alexandre Julliard 4bbe8f90d4 winex11: Ignore X11 errors happening on the clipboard display connection.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-26 21:54:31 +09:00
Alexandre Julliard a52d09198d winex11: Run a single clipboard manager thread per window station, inside the explorer process.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-26 21:53:52 +09:00
Alexandre Julliard 80d02bc849 winex11: Support import multiple drag&drop properties in a single call.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-22 22:15:10 +09:00
Alexandre Julliard 2215d770c5 winex11: Merge converting the selection and importing it.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-21 21:17:19 +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 10b526733f winex11: Implement FillPath, StrokeAndFillPath and StrokePath.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-17 00:09:20 +09:00
Jacek Caban ecf9e9135d winex11.drv: Use grabbed window display in SetCapture.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-14 13:54:50 +09:00
Jactry Zeng c2dc6f3ef2 winex11: Implement FlashWindowEx.
Signed-off-by: Jactry Zeng <jzeng@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-13 23:35:27 +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
Alexandre Julliard 070a82e743 user32: Merge the AcquireClipboard and EmptyClipboard driver entry points. 2015-06-03 18:46:53 +09:00
Francois Gouget c223994b7a winex11.drv: Make X11DRV_XROPfunction static. 2015-03-16 15:03:39 +09:00
Damjan Jovanovic 1a20050826 winex11.drv: Support XDnD version 5. 2015-03-03 18:12:46 +09:00