Commit Graph

7775 Commits

Author SHA1 Message Date
Emmanuele Bassi
34038aaf7d Merge branch 'wip/fix-randr-race-3-24' into 'gtk-3-24'
x11: Trap error when getting CRTC info [3.24]

See merge request GNOME/gtk!4168
2021-11-24 16:48:39 +00:00
Luca Bacci
78a0cdde83
Quartz: Fix keyboard layout notification
Register for notifications before initializing keymaps
2021-11-24 16:20:02 +01:00
Jonas Ådahl
102341ae9f x11: Trap error when getting CRTC info
This should fix a race happening when RANDR changes quickly, e.g. during
unit testing where tests change monitor configurations rapidly.
2021-11-17 11:14:00 +01:00
Luca Bacci
4d40300d8a
GdkWin32: Make OLE2 DND work in monitors with different OS scales
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3734
2021-11-13 19:41:58 +01:00
Luca Bacci
a174568ef9 Merge branch 'gtk3-dnd-find-dest-window-fix' into 'gtk-3-24'
GdkWin32: Fix DND destination window search

See merge request GNOME/gtk!3885
2021-11-13 14:51:49 +00:00
Luca Bacci
ae8fde9630 Merge branch 'win32-gl-reorg-3' into 'gtk-3-24'
GDK-Win32: Reorganize backend GL code and add fallback mode

See merge request GNOME/gtk!3859
2021-11-06 11:21:43 +00:00
Carlos Garnacho
d81f58bc09 gdk/wayland: Do not use xdg_wm_base.ping serials as "user input" serials
Ping/pong serials are not meant to be interpreted as user input serials
(e.g. those given back later to the compositor on grabs). As a matter
of fact, Mutter uses a different count (i.e. timestamps) in these, so
using these serials may confuse the compositor into denying certain
operations like DnD.
2021-11-05 14:43:23 +01:00
Matthias Clasen
1e72dac839 Merge branch 'wip/hadess/quiet-broadway-gtk3' into 'gtk-3-24'
broadway: Quiet initialisation failures

See merge request GNOME/gtk!4052
2021-10-19 02:45:56 +00:00
Matthias Clasen
25d01b7610 Merge branch 'wip/fix-remap-up-left-popup' into 'gtk-3-24'
window/wayland: Reset position when hiding popup

See merge request GNOME/gtk!3913
2021-10-18 22:34:39 +00:00
Jonas Ådahl
0f871584fc Merge branch 'surfaceloop' into 'gtk-3-24'
Check if size changed before hiding a surface

See merge request GNOME/gtk!3944
2021-10-18 14:20:44 +00:00
Luca Bacci
d34f4416bd Merge branch 'gdk-win32-ensure-correct-order-of-operations-when-handling-dpi-scale-and-gdk-screen-offset' into 'gtk-3-24'
GdkWin32: Ensure consistent order of operations when handling DPI scale and GDK screen offset

See merge request GNOME/gtk!3931
2021-10-18 11:36:47 +00:00
John Ralls
36315cbe2b [quartz]Use the absolute value of Scale values for CGContextScaleSCM
In macOS-12.sdk CGContextConverSizeToDeviceSpace returns a negative
height and passing that to CGContextScaleCTM in turn causes the cairo
surface to draw outside the window where it can't be seen. Passing the
absolute values of the scale factors fixes the display on macOS 12 without
affecting earlier macOS versions.
2021-10-14 12:45:48 -07:00
Bastien Nocera
e7679635b0 broadway: Quiet initialisation failures
Broadway is the only GTK+ backend that throws an error on stderr for a
"display server" connection failure.

This causes problems when gtk_init_check() is used and unexpected error
output is generated such as with hotdoc, which fails when generating a
GTK plugin's documentation instead of overlooking the issue.

"Unable to init server: Could not connect: Connection refused"
2021-10-11 20:29:40 +02:00
Ting-Wei Lan
26d61e2abc GDK/Win32: Fix MinGW autotools build
MinGW-w64 CRT provides no 'hid.lib' file. Instead, it has 'libhid.a'
which can be linked with '-lhid' linker argument.

Also, we have to declare the '_LIBADD' variable and add 'LDADDS' to it,
or 'LDADDS' won't do anything for the build.
2021-09-24 00:06:51 +08:00
Luca Bacci
378ed797a4
GdkWin32: Initialize _gdk_offset_x / _gdk_offset_x to unscaled values
Note that gdk_monitor_get_geometry () returns DPI-scaled values,
while the screen offset should be unscaled, as scales are properties
of indivdual monitors.
2021-09-23 17:37:54 +02:00
Luca Bacci
876a2e6225
GdkWin32: Ensure a consistent order of operations when handling DPI scale and GDK screen offset 2021-09-23 17:37:45 +02:00
Luca Bacci
cac1c7cd22
GdkWin32: Use a signed integral type for the DPI scale
An arithmetic operation involving a signed and an unsigned operand
of the same rank will have both operands converted to *unsigned*.
That's an issue if the signed operand actually has a negative value.

That was causing issues with the handling of monitor geometries that
had negative x / y positions.
2021-09-23 15:28:42 +02:00
Ronan Pigott
23c7e6e13b Check if size changed before hiding a surface
Commit 68188fc948 introduces a workaround for clients that try to
change the size of a popup after it is created, but inadvertently
introduces an infinite loop of surface creation when the popup enters
two or more wl_outputs with different scales on creation.

This commit checks if the size actually changed before applying the
workaround and avoids the loop.
2021-09-13 17:14:14 -07:00
Ronan Pigott
9a4e328928 Ignore wl_output globals not bound by us
Gdk doesn't know the scale of output globals it didn't bind. This
keeps them from entering the output list and triggering erroneous
changes in surface scales.
2021-09-13 03:08:49 -07:00
Luca Bacci
c71dca236c
Use WindowFromPoint to find DND target window 2021-09-10 13:59:27 +02:00
John Ralls
a752e33838 Update Quartz version detection for macOS 12. 2021-09-08 18:01:50 -07:00
John Ralls
e9d4b0dda0 Move includes of gdkinternal-quartz.h from headers to impl files.
gdkinternal-quartz.h isn't installed but the headers that included
it are, which which would cause the build to fail if an external
project included one of them.

Also changed the includes in gdkinteral-quartz.h to local for
faster loading.
2021-09-07 11:08:11 -07:00
John Ralls
7e732caa1e Let gdkquartz-cocoa-access.h find gdkquartz.h during build.
gdkquartz.h is installed in $PREFIX/include/gdk but is in gdk/quartz
in the source tree. Use "gdkquartz.h" to find it in both places.
2021-09-07 10:39:37 -07:00
Chun-wei Fan
bcdbb93296 GDK-Win32: Add fallback mode to GLES
...if GLES (libANGLE) support was enabled in the build.  This way, we can
check whether the GL driver is capable enough to support the OpenGL
features that we use in GTK.  If the driver is not capable enough, and
GLES support is enabled, we can try to create the GdkGLContext again as a
GLES context.
2021-09-06 19:36:14 +08:00
Chun-wei Fan
97d3024701 gdk/win32: Some further small GL-related cleanup
Remove from gdkglcontext-win32.h items that aren't really necessary, and
just include gdkglcontext-win32.h where applicable.
2021-09-06 19:36:13 +08:00
Chun-wei Fan
9e949209a1 GDK-Win32: Reorganize gdkgdlcontext-win32.c
Group the WGL-specific code and GLES-specific code together, so that we
can reduce the number of #ifdef ... in the code, to make the code more
readable and easily maintained.  This will pave the way to add a
fallback mode to use libANGLE (OpenGL/ES) in case the Desktop OpenGL
support is inadequte, if OpenGL/ES support is enabled in the build.

This is somewhat based on the updates that were done in GTK master, so
we are using one subclass for WGL-based GdkGLContexts, and another for
GLES-based GdkGLContexts.

Also remove the underscores in many of the functions in
gdkglcontext-win32.*.

Clean up the code a bit as a result.
2021-09-06 19:36:13 +08:00
Jonas Ådahl
d74b01636b window/wayland: Reset position when hiding popup
When a popup is remapped, if the GdkWindow::x/y position is negative,
some best-effort hueristics used to ignore internal X11-style hackery
windows incorrectly scooped up remapped popup windows.

Avoid these hueristics by resetting the x and y fields of GdkWindow to 0
whe hiding a popup. It'll then appear as if it was newly initialized,
and escape the mentioned hueristics.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4071
2021-09-02 10:24:38 +02:00
Hiroyuki Ito
ec4d27a4fc accepts NSPasteboardTypeFileURL as "text/uri-list". 2021-08-14 09:38:36 +09:00
Matthias Clasen
d450cbe517 Merge branch 'opengl.win32.fixes' into 'gtk-3-24'
GDK/Win32: Fix up OpenGL a bit (part of !3767 for GTK3)

See merge request GNOME/gtk!3792
2021-07-28 17:55:51 +00:00
Chun-wei Fan
15817973d7 GDK/Win32: Fix up OpenGL a bit
Like the recent updates in GTK4, the HWND that we use to obtain the HDC
that we need for OpenGL/GLES operations should really be tied to
GdkWindow, not GdkDisplay, as that is where the Win32 HWND where we
originate from is located, so stop storing the GL HWND in
GdkWin32Display, but just grab them from the GdkWindow that is bound to
the GdkGLContext.

We are more conservative about freeing up GL resources in GTK3, so we
will continue to call ReleaseDC() as we did before.
2021-07-28 11:28:17 +08:00
Chun-wei Fan
71aa479d16 gdkdevicemanager-win32.c: Fix build
Fix the call to p_WTSetA, as we should be passing in a HCTX, not a
HCTX*.  Also clean up things a bit.
2021-07-28 09:58:06 +08:00
Chun-wei Fan
71d7054ff7 Merge branch 'wintab-set-cxo-system-option' into 'gtk-3-24'
Wintab: Set the CXO_SYSTEM option

See merge request GNOME/gtk!3644
2021-07-12 01:52:57 +00:00
John Ralls
6128492cc0 [quartz] Fix incorrect include path for gdkquartz.h 2021-07-10 13:57:11 -07:00
Matthias Clasen
a8c83fe3bc Merge branch 'gdkkeys' into 'gtk-3-24'
gdkkeys-win32.c: fix initialisation of key_state in update_keymap

See merge request GNOME/gtk!3741
2021-07-09 10:58:09 +00:00
Luca Bacci
de31fdcc68
Add winpointer.h to Makefile.am sources list 2021-07-09 09:00:36 +02:00
Jeremy Tan
7303854310 gdkkeys-win32.c: fix initialisation of key_state in update_keymap
It apparently worked by chance in the past, but now causes e.g.
alphanumeric characters to be interpreted as half-width katakana
when using the Japanese IME.
2021-07-09 12:35:44 +08:00
Vlad Zahorodnii
92ba4bf396 gdk/wayland: Fix pointer-gestures version selection
version == GDK_ZWP_POINTER_GESTURES_V1_VERSION will fail if the
compositor implements version 2 of pointer-gestures-v1.
2021-07-05 14:50:59 +02:00
Luca Bacci
712721b60a
Add support for Windows Pointer Input Stack
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1563
2021-07-03 16:04:28 +02:00
Chun-wei Fan
88730e81c1 Merge branch 'fix-issue-2019' into 'gtk-3-24'
[Gtk3] GdkWin32: Remove klassTEMPSHADOW

See merge request GNOME/gtk!2749
2021-06-22 06:51:56 +00:00
Tom Schoonjans
66b533408d quartz: fix compilation on macOS 10.10 2021-06-12 06:10:54 +01:00
Luca Bacci
f67bf8d892
Wintab: Set the CXO_SYSTEM option
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3860
2021-06-11 19:52:44 +02:00
Luca Bacci
af747315d7
Wintab: set the right device field in the event structure
Even when sends_core is FALSE

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3860
2021-06-11 19:52:43 +02:00
Matthias Clasen
6d6d76ecbb Merge branch 'arb_fbo' into 'gtk-3-24'
Switch to GL_ARB_framebuffer_object

See merge request GNOME/gtk!2076
2021-06-08 14:59:05 +00:00
Luca Bacci
547ea8b073
Backport 'fix integer overflow in monitor refresh rate calculation' to GTK3
Original MR by Volker Rümelin.

See https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/2884
2021-06-04 17:44:49 +02:00
Mosè Giordano
0e14822a22 Fix value of MAC_OS_X_VERSION_MAX_ALLOWED 2021-05-07 11:46:47 +01:00
Guido Günther
8c0b11998d gdk/wayland: Take transform into account when setting physical size
Width and height of a GdkMonitor are derived via wl_output which
talks about physical dimensions of a device and compositors usually
implement this as the untransformed values (e.g. weston, wlroots).

Since the GTK client has no way to figure out if a monitor was rotated,
transform the physical dimensions according to the applied wayland
transform to have the physical dimensions match the logical ones.

Mutter flips the physical dimensions itself but doesn't announce the
transform so this shouldn't break anything there.
2021-05-05 18:09:07 +02:00
Matthias Clasen
fa70d08387 Merge branch 'quartz-drag-crash' into 'gtk-3-24'
Ensure gdk_quartz_drag_source freed on all paths.

See merge request GNOME/gtk!3498
2021-05-04 16:17:13 +00:00
John Ralls
a6c3887736 Ensure gdk_quartz_drag_source freed on all paths.
New release function _gdk_quartz_drag_source_context_destroy_gtk_only
gets called when drag fails to start or is cancelled as well as
when it successfully completes.
2021-05-04 08:33:56 -07:00
Chun-wei Fan
1b1dee86a5 gdkglcontext-win32.c: Fix running with Mesa drivers
Some GL drivers such as Mesa-D3D12 do not allow one to call SetPixelFormat() on
a given HDC if one pixel format has been already set for it, so first check the
HDC with GetPixelFormat() to see whether a pixel format has already been set
with the HDC, and only attempt to acquire the pixel format if one has not been
set.

This will fix running with GL on Windows using the Mesa drivers.
2021-04-29 12:17:58 +08:00
Matthias Clasen
ca6794b2d8 Merge branch 'untrusted-beep-3' into 'gtk-3-24'
x11: Don't beep on untrusted displays

See merge request GNOME/gtk!3462
2021-04-21 10:12:19 +00:00