Commit Graph

10472 Commits

Author SHA1 Message Date
Chun-wei Fan
0fe37d1828 gdkdisplay-win32.c: Clean up GL initialization further 2022-01-19 11:56:32 +08:00
Chun-wei Fan
43839898b3 GDK: Force GLES 3.0+ on libANGLE
...when libANGLE is being used on Windows, by checking for a
Windows-specific an ANGLE-specific extension.
2022-01-19 11:56:32 +08:00
Chun-wei Fan
6f2848c311 Cleanup "GDK/Win32: Try to fix initializing GLES contexts"
As per Benjamin's suggestions, cleanup the previous implementation on
initializing the GLES context on Windows, so that we use more items that are
already in GDK proper and integrate two functions into one.
2022-01-19 11:56:32 +08:00
Chun-wei Fan
38c17c1f79 gdkglcontext-win32-wgl.c: Cleanup GL context creation
Instead of first trying to explicitly ask for a WGL 4.1 context, ask for
the WGL context version that matches what is reported via
epoxy_gl_version(), so that we get the maximum WGL version that is
supported by the graphics drivers, and make sure any WGL contexts that
are shared with this (initial) WGL context are created likewise.

We can try to do a default-bog-standard 3.2 core WGL context creation
if the need arises, but let's leave that alone for now.
2022-01-19 11:56:32 +08:00
Chun-wei Fan
b85aa10700 gdkglcontext.c: Ensure EGL contexts are in-sync with shared context
The EGL context that we are actually creating must have matching OpenGL/ES
versions and allowed GL API set with the previously-created EGL context
that will be shared with it so that they can interoperate together, if
applicable.

This will fix the situation by making sure that we request for the
OpenGL/ES version and OpenGL API set that match with what we have in our shared
EGL context.  Otherwise, the newly-created EGL context assumed a OpenGL/ES 2.0
context that supported desktop OpenGL, which may not be what we wanted, such as
in the case of libANGLE.
2022-01-19 11:56:32 +08:00
Chun-wei Fan
598c7d9cf4 GDK/Win32: Try to fix initializing GLES contexts
We are now able to create EGL contexts properly on Windows, but not GLES.  This
tries to fix things by doing the following:

*  Record the GL context type in a more proper fashion, using an Enum.  This
   makes things a bit cleaner.
*  Force GLES-3.0+ contexts, since libANGLE requires this to properly work with
   the shaders-its 2.0 contexts don't work well with our shaders.
2022-01-19 11:56:32 +08:00
Matthias Clasen
6fd29e6600 Merge branch 'wip/wayland-surface-offset' into 'main'
Fix DND hotspot position under Wayland + EGL/Vulkan

See merge request GNOME/gtk!3705
2022-01-18 23:48:26 +00:00
Matthias Clasen
b67636747b Merge branch 'gdksurface-wayland-assert' into 'main'
gdksurface-wayland: Fix contradictory assert

See merge request GNOME/gtk!4385
2022-01-18 23:46:59 +00:00
Matthias Clasen
1b15f89dfd Merge branch 'wip/dont-always-restore-saved-gtk4' into 'main'
wayland: Don't always restore the saved size when floating

Closes #4634

See merge request GNOME/gtk!4394
2022-01-18 23:40:49 +00:00
Jonas Ådahl
be7a391a13 wayland: Don't always restore the saved size when floating
We only save the size when we transition from floating to fixed, so that
we can restore the size to the one prior to being fixed.

However, we should not restore to this size whenever we see a 0x0 size
from xdg_toplevel, as it can do that any time it doesn't care about the
size, e.g. when the surface is floating and just changing state.

Fix this by only using the saved size when transitioning from fixed to
floating, not when staying floating while previously floating.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4634
2022-01-18 15:46:10 +01:00
Luca Bacci
93bc97b7ec Merge branch 'fix-keyboard-shortcuts-win32' into 'main'
Win32 key events cleanup

See merge request GNOME/gtk!4349
2022-01-17 13:34:17 +00:00
Luca Bacci
243bb57a27
GdkWin32: Add translation result w/o CAPS LOCK to key events for accelerator matching 2022-01-17 14:14:55 +01:00
Luca Bacci
4916ebd05e
GdkWin32: Remove _gdk_input_codepage variable
It's unused
2022-01-17 14:14:55 +01:00
Luca Bacci
8bbf48eb64
GdkWin32: Code reorganization for gdk_event_translate 2022-01-17 14:14:47 +01:00
Chun-wei Fan
905f021bbd Revert "Bug 676077: Fix handling of Keyboard Input on Windows"
The actual code that does the IM context code handling on Windows now uses the
native Windows APIs to handle keystrokes, so this patch is no longer needed, as
it was found that it instead caused issues.

Pointed out in issue #2865.

This reverts commit fd6ce9975e.
2022-01-17 11:38:37 +01:00
Kritphong Mongkhonvanit
55016ada92 gdksurface-wayland: Fix contradictory assert
gdk_wayland_toplevel_inhibit_idle() contained a contradictory assert
that always fail. More specifically, in the branch that is supposed to
create the idle inhibitor, there is an assertion that it must already
exist and that the refcount must be greater than zero. This causes a
crash on WMs/DEs that use the ZWP idle inhibit manager protocol such as
KDE Plasma and Sway. Fix this by just asserting that the refcount is
zero instead.
2022-01-17 15:50:08 +07:00
Jonas Ådahl
66ebc660b4 wayland/surface: Use wl_surface_offset() instead of x,y of attach()
This makes the hotspot of DND surfaces work when using the Vulkan and
OpenGL renderers.

This bumps the CI image used to the newly built image. This is needed to
install a new enough libwayland-client.so needed for wl_surface.offset.

This is done by adding wayland as a meson subproject, building it
on-demand if the version in the system is not new enough. As
libwayland-client.so is pulled in implicitly when linking to gtk4, the
compile step needs LD_LIBRARY_PATH set to make ld find the right library
to link to.
2022-01-14 09:27:07 +01:00
Luca Bacci
06e5da456f Merge branch 'win32-fix-altgr-gtk4' into 'main'
IMContextSimple/IMContextIME: Fix AltGr not working on Win32 [GTK4]

See merge request GNOME/gtk!4375
2022-01-13 23:02:50 +00:00
Philip Zander
b9bc7d9166 IMContextSimple/IMContextIME: Fix AltGr not working on Win32
The old code assumed that any key press containing Ctrl or Alt cannot be
regular text input. This is not correct on Win32 as AltGr = Ctrl + Alt.
2022-01-13 17:26:59 +01:00
Emmanuele Bassi
63ee135a1e Update the link to the development branch
The default development branch for GTK is now "main".
2022-01-13 14:42:34 +00:00
David Hogan
7d6257cb1e
gdkkeys-win32: Perform keyboard layout substitution
For some users, GetKeyboardLayoutNameA() returns an alias instead of the
fully resolved keyboard layout identifier. In that case, we have to
query the registry to resolve the alias before we can look up the DLL
path.

See comments under https://gitlab.gnome.org/GNOME/gtk/-/issues/4610
2022-01-12 21:44:28 +01:00
Philip Zander
db0234ecb4
gdkkeys-win32: Fix handling of SGCAPS
Contrary to what you can read on the internet, SGCAPS keys don't work
by having capslock toggle the KBDCTRL bit, they actually have two
consecutive table entries, the first of which is for the normal
version and the second of which is for the capslocked version.

Background: SGCAPS is short for Swiss German caps because Swiss German
was the first layout to use this feature. For keys with the SGCAPS flag,
capslock has a different effect than pressing shift. For example:
Shift + ü = è,  CapsLock + ü = Ü,  CapsLock + Shift + ü = È
2022-01-12 21:44:24 +01:00
Philip Zander
438fad803e
gdkkeys-win32: Fix crash when keyboard DLL failed to load
DLL loading failures should not happen under normal circumstances, but
we should at least try not to crash and and print better diagnostic
messages if they do happen.

See https://gitlab.gnome.org/GNOME/gtk/-/issues/4610
2022-01-12 21:44:15 +01:00
Philip Zander
82f8f878bc
gdkkeys-win32: Add keysym mapping for capslock key
Add missing mapping between VK_CAPITAL and GDK_KEY_Caps_Lock, so
applications get a meaningful keyval rather than ffffff.
2022-01-12 21:44:07 +01:00
Philip Zander
b0818f9535
gdkkeys-win32: Fix capslock handling
Previously, we treated CapsLock and KanaLock as part of the global
keyboard state, much like NumLock and ScrollLock, rather than using
the supplied modifier mask. This was because GDK does not have a
modifier mask for KanaLock, only for CapsLock, so it would not have been
possible to properly support it.

However, this approach ended up causing problems, with certain keyboard
shortcuts not registering when capslock was active. This was first
observed in Inkscape [0] and appears to affect shortcuts consisting of a
single key (like 'a') with no additional modifiers (wheareas shortcuts
like 'ctrl+a' work).

So now we are using the supplied GDK_LOCK_MASK instead, and dropped
support for KanaLock, which we probably don't need anyway (since regular
text input should be handled by the IME input module -- the keymap is
mainly for shortcuts and keybindings, where you don't really want
KanaLock).

[0] https://gitlab.com/inkscape/inkscape/-/issues/3082
2022-01-12 21:43:53 +01:00
Luca Bacci
c71cb35e9d Merge branch 'forward-port-rewrite-gdkwin32keymap-to-gtk4' into 'main'
Rewrite GdkWin32Keymap (V2)

Closes #1033 and #2055

See merge request GNOME/gtk!4338
2022-01-12 19:53:54 +00:00
Matthias Clasen
7257d1c15f Revert "gir: Annotate GdkTexture constructors for reading from a file/memory/resource to return a GdkMemoryTexture"
This reverts commit ae8e844dec.

No agreement that this will stay this way going forward.
2022-01-12 14:11:20 -05:00
Philip Zander
ea65abc7e2
Rewrite GdkWin32Keymap (load table directly from layout DLL)
The old code used repeated calls to `ToUnicodeEx` to populate
the translation table, which is slow and buggy. The new code
directly loads the layout driver DLLs from Windows.

See https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4338
2022-01-12 19:01:35 +01:00
Matthias Clasen
93ff65c685 Merge branch 'should_be_mapped' into 'main'
gdk/wayland/surface: Remove redundant `should_be_mapped` code

See merge request GNOME/gtk!4203
2022-01-12 02:48:10 +00:00
Matthias Clasen
7e7201745d Merge branch 'wip/keep-scale' into 'main'
wayland/surface: Only update the scale if on any outputs

See merge request GNOME/gtk!4352
2022-01-12 02:46:43 +00:00
Sebastian Dröge
ae8e844dec gir: Annotate GdkTexture constructors for reading from a file/memory/resource to return a GdkMemoryTexture 2022-01-11 15:46:22 +02:00
Simon McVittie
979c124e57 png: Correct endianness for big-endian machines
libpng wants to receive samples in either RGB or RGBA order, whether
each sample is big-endian or not. This resolves test failures in
testsuite/gdk/memorytexture.c (and a lot of reftests) on s390x, and
probably the PowerPC family too.

Modifying the test to show the color in use and write out the PNG bytes
to a file, and running the memorytexture test on s390x, produces a PNG
that loads with the correct color values in GIMP (on an x86_64 machine),
which seems like evidence that this is the correct change and not just
compensating errors.

Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/4616
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-01-08 17:09:29 +00:00
Jonas Ådahl
6efcc02806 wayland/surface: Only update the scale if on any outputs
If we ended up on no output at all, keep the HiDPI scale as is, as it
likely means we were on a workspace that was switched away from. By
keeping the same scale, we avoid unnecessary scale changes that would
otherwise take place if the scale when on monitors would end up being
more than 1.
2022-01-07 19:32:04 +01:00
Matthias Clasen
87ac411c50 Merge branch 'doc-improvs-ii' into 'main'
Doc improvements on textures

See merge request GNOME/gtk!4342
2022-01-07 03:16:19 +00:00
Benjamin Otte
8e8a746cce Merge branch 'wip/otte/for-main' into 'main'
testsuite: clear_current() when done

See merge request GNOME/gtk!4343
2022-01-06 19:07:58 +00:00
Maximiliano Sandoval R
ee71effe98
docs: State that Textures are thread safe gobjects 2022-01-06 19:30:54 +01:00
Maximiliano Sandoval R
ce2c4f0f08
docs: Improve docs for MemoryTexture 2022-01-06 19:30:30 +01:00
Maximiliano Sandoval R
ef9dbf73cc
gir: Add type annotations for {GL,Memory}Texture 2022-01-06 19:30:29 +01:00
Maximiliano Sandoval R
3bed5334bf
docs: Improve docs for gdktexture.c 2022-01-06 19:30:28 +01:00
Benjamin Otte
5dc940ead2 glcontext: Don't spew warnings on surfaceless contexts
Get the display directly instead of via the nonexisting surface.
2022-01-06 19:23:29 +01:00
Florian Müllner
9e5d412a8b gdk/display-wayland: Don't bypass portal for theme entries
When commit 49589e1da added support for the new high-contrast key,
it missed that the getter should only use the setting directly when
not going through the portal.

https://gitlab.gnome.org/GNOME/gtk/-/issues/4593
2022-01-04 14:58:58 +01:00
Emmanuele Bassi
5cb8d15505 Merge branch 'fredmorcos-master-patch-48389' into 'main'
Minor doc fix

See merge request GNOME/gtk!4325
2022-01-03 13:34:00 +00:00
Fred Morcos
31714e5c1d Minor doc fix 2022-01-03 10:27:51 +00:00
Luca Bacci
07b04fbea9
Remove some unneeded files from gdk/win32
bdfcursor.c, cursor.bdf and libwntab32x.la
2022-01-02 18:49:44 +01:00
Luca Bacci
2f685d5d2a
Remove leftover code dealing with input-only windows 2022-01-02 18:42:33 +01:00
Luca Bacci
4f7d18a28f
Do not use GetProcAddress for FlashWindowEx
It's available since Windows XP
2022-01-02 18:42:32 +01:00
Luca Bacci
c77272a7d7
Remove call to ShowOwnedPopups (FALSE) to hide owned windows
This is needed to fully support windows with the property
"destroy-with-parent" set to FALSE.
2022-01-02 18:42:31 +01:00
Luca Bacci
7a1004df73
Remove WM_SYNCPAINT message handler
It was added to work around what seemed to be an OS or graphics
driver issue on Windows XP. The issue was not reproducible on
Windows Vista anyway.

References:
* https://bugzilla.gnome.org/show_bug.cgi?id=153567
* https://gitlab.gnome.org/GNOME/gtk/-/commit/c8fef535
* https://devblogs.microsoft.com/oldnewthing/20120723-00/?p=7073
2022-01-02 18:42:31 +01:00
Matthias Clasen
2441bdb900 Merge branch 'radioactiveman-main-patch-13472' into 'main'
texture: Fix typo in error message

See merge request GNOME/gtk!4311
2022-01-02 00:51:43 +00:00
Thomas Lange
8767ffde2f texture: Fix typo in error message 2022-01-01 17:23:22 +00:00
Bilal Elmoussaoui
a336fe2850 gdk: add missing nullable annotations 2022-01-01 17:03:10 +01:00
m-shinder
6fd4421add Merge branch 'main' into 'm-shinder-master-patch-90567'
# Conflicts:
#   NEWS
2021-12-26 21:20:33 +00:00
Benjamin Otte
5803dd765d gles: glGetTexLevelParameter() isn't supported 2021-12-25 15:07:44 +01:00
Benjamin Otte
6a310b5069 gles: GLES 2 doesn't have glDrawBuffers()
So don't call it.
2021-12-25 15:07:44 +01:00
Benjamin Otte
2caab68be9 gl: Change gdk_gl_context_check_version()
Instead of just passing major/minor, pass them twice, once for GL and
once for GLES. This way, we don't need to check for GL and GLES
separately.

If something is supported unconditionally, passing 0/0 works fine.

That said, I'd like to group the arguments somehow, because otherwise
it's just a confusing list of numbers - but I have no idea how to do
that.
2021-12-25 15:07:44 +01:00
Benjamin Otte
4e2dbc1258 glcontext: Use different log levels for GL debug
We want critical GL debug messages to be critical, so that the testsuite
sudokus itself when they appear.

This is relevant in particular for GLES warnings in the GLES runner,
because its warnings can cause crashes on GL drivers less forgiving than
Mesa.

Related: #4571
2021-12-25 15:07:44 +01:00
Emmanuele Bassi
40eca1a68e Apply 1 suggestion(s) to 1 file(s) 2021-12-25 13:29:07 +00:00
m-shinder
98f937ba15 Fix: Set direction for value parameter 2021-12-25 10:04:43 +00:00
Benjamin Otte
c419799313 gl: Clear current when destroying current's surface
When destroying the EGLSurface or GLXDrawable of a GdkSurface, make sure
the current context is not still bound to it.

If it is, clear the current context.

Fixes #4554
2021-12-22 20:00:52 +01:00
Matthias Clasen
88726e12f7 Merge branch 'high-contrast-4' into 'main'
gdk/wayland: Support new `high-contrast` key

See merge request GNOME/gtk!4271
2021-12-21 19:20:34 +00:00
Florian Müllner
49589e1da1 gdk/wayland: Support new high-contrast key
We now have a boolean setting that determines whether the high-contrast
theme should be used. Support it by automatically setting the existing
`gtk-theme-name` and `gtk-icon-theme-name` properties when enabled.

With that, it is no longer necessary to change the regular theme settings
for high-contrast, so toggling between high-contrast and a non-default
theme finally works reliably.
2021-12-21 14:02:02 +01:00
Matthias Clasen
552267b93d Don't keep discrete scroll events in the queue
We are not going to compress those anyway.
2021-12-20 14:51:37 -05:00
Luca Bacci
5e090c1fac Merge branch 'fix-3728-3799' into 'main'
GDK-Win32: Force toplevel surfaces to configure as needed (fix issues #3728 and #3799)

Closes #3728 and #3799

See merge request GNOME/gtk!3712
2021-12-16 14:58:03 +00:00
Matthias Clasen
27fa51cfa6 wayland: Add sequences for touchpad gestures
It makes sense.
2021-12-15 21:58:57 -05:00
Matthias Clasen
2772ff624f gdk: Prepare touchpad events for sequences
It makes sense to connect the begin/update/end events
for touchpad swipes and pinches in a sequence. This
commit adds the plumbing for it, but not backends
are setting sequences yet.
2021-12-15 21:58:57 -05:00
Matthias Clasen
abf6068d91 docs: Add some information about event axes 2021-12-15 21:58:57 -05:00
Matthias Clasen
6012276093 Fix event history
Collecting of history wasn't working correctly
for either motion or scroll events.
2021-12-15 00:30:50 -05:00
Matthias Clasen
56532a505d Cosmetrics: Remove mention of a nonexisting type
No such thing as GdkScrollHistory.
2021-12-14 23:42:35 -05:00
Matthias Clasen
4d865cd7ba tiff loader: Catch more errors
tiff_open_read may fail, and we should not crash
in that case but return an error.
2021-12-13 17:54:11 -05:00
Benjamin Otte
af2a172197 Merge branch 'wip/otte/for-main' into 'main'
x11: Fix a deadlock in INCR transfers

See merge request GNOME/gtk!4242
2021-12-13 01:17:00 +00:00
Benjamin Otte
252b9fc39c x11: Don't delete important signal handlers randomly
We finish the write to the output stream long after the stream has been
closed, so we want to keep the event handler around to do just that.

Instead, remove the handler on finalize.
2021-12-13 01:54:21 +01:00
Benjamin Otte
6fc5e04d7c x11: Explicitly track end of stream
The OutputStream needs to write a 0 byte end of stream Property. We need
to track if that has been written, and we do that with that new
property.

We also use that property to always request flushes when the stream is
being closed, so that we don't wait for another flush() call.
2021-12-13 01:52:30 +01:00
Benjamin Otte
66f1fef083 x11: Explicitly close_async() the output stream
We need to be very careful when writing data, because if we aren't, sync
functions will be called on the output stream and X11 does not like that
at all.
2021-12-13 01:51:35 +01:00
Benjamin Otte
645d4807c3 x11: Keep a reference to the SelectionOutputStream while writing
This ensures close() isn't called from dispose() while we're still busy
writing.

In theory this should never happen, but in practice it just did.
2021-12-13 01:42:45 +01:00
Matthias Clasen
a463ead739 gdk: Drop some pointless code
There is no point in sorting png first when
registering (de)serializers, since we ignore
the png format now when walking the list.
2021-12-12 18:36:58 -05:00
Benjamin Otte
4cd0a39794 Merge branch 'wip/otte/inspector' into 'main'
inspector: Add a clipboard page

See merge request GNOME/gtk!4237
2021-12-11 22:46:30 +00:00
Benjamin Otte
5fbc510f94 contentformats: Make sure 0 elements means the array is NULL
Don't return arrays with 0 elements, return NULL.
2021-12-11 23:21:53 +01:00
Matthias Clasen
5371e4403e Merge branch 'deprecate-device-source' into 'main'
Deprecate GdkDevice:source

See merge request GNOME/gtk!4207
2021-12-10 18:35:00 +00:00
Bilal Elmoussaoui
57518a2bb4 gdk: drop removed method from the header 2021-12-09 20:29:17 +00:00
Christian Hergert
15d01d4315 surface: add missing va_marshaller for layout signal
I saw this coming across through a ffi boundary in Sysprof, and we wanted
to keep most things within GDK using native marshalling to improve
profiler results when frame pointers are not used.
2021-12-07 22:21:19 -08:00
Chun-wei Fan
bdf879427c gdksurface-win32.c: Call gdk_surface_set_egl_native_window()
.. when creating the surface (with the HWND associated with the
newly-created surface) as well as destroying the surface (with NULL,
since the HWND is going to be destroyed), so that we can tie the EGL
calls to the HWND that we want to do the EGL stuff.
2021-12-03 10:39:59 +08:00
Carlos Garnacho
9539cc4a93 gdk/wayland: Unset GDK_BUTTON1_MASK on proximity_in
In some circumstances (e.g. activating with a stylus something that
closes a window), we can receive zwp_tablet_tool.proximity_out without
receiving a zwp_tablet_tool.up beforehand.

In those cases, we are not expecting neither .up nor .button, so
reset the stylus device button modifiers on proximity_out.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4103
2021-12-02 17:06:35 +01:00
Carlos Garnacho
72cf304a86 gdk/wayland: Use right modifiers for tablet button events
We are looking up the seat logical pointer modifiers (i.e. the wl_pointer),
not the ones for the tablet tool device. This breaks accounting further
along in GTK leaving stuck implicit grabs.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4102
2021-12-02 17:06:35 +01:00
Matthias Clasen
fd9e0dd13a Deprecate GdkDevice:source
GdkDeviceTool is more consistently supported across
backends, and provides the same information.
2021-12-01 14:04:35 -05:00
Chun-wei Fan
da535164b4 gdksurface-win32.c: Rename window->surface as appropriate
Update the functions that were updated in the previous commit to have all
GdkSurface variables named as 'surface' instead of the GTK-3.x-era window, to
make things more consistent across the board.  Also fix formatting a bit.
2021-12-01 17:32:40 +08:00
Chun-wei Fan
82d9570ed4 GDK-Win32: Make surface ready for updates
Make the toplevel surface respond to size computations unless it is just being
created, or maximized, made fullscreen or underwent an AeroSnap operation.

This will ensure that the surface size is properly computed in time, so that
surfaces can be resized as needed.

This will fix issues 3728 and 3799.
2021-12-01 17:32:40 +08:00
Ian Douglas Scott
25ec20d861 gdk/wayland/surface: Remove redundant should_be_mapped code
As far as I can tell, the code here is redundant and probably ended up
this way for historical reasons. A drag surface without
`->is_drag_surface` would be created if `gdk_display_create_surface`
were called with `GDK_SURFACE_TEMP`, but drag surfaces never seem to be
created that way.

In `gtk4-demos`, drag and drop and popovers seem to be working normally
with this.
2021-11-30 10:36:46 -08:00
Benjamin Otte
354fa6544a texture: Remove gdk_texture_download_float()
The download API is not well thought out yet, so postpone it until
there's an actual usecase for it.

Remove testcases, too.
2021-11-30 14:12:10 +01:00
Matthias Clasen
9aaf54140f Merge branch 'wip/fix-randr-race' into 'master'
x11: Trap error when getting CRTC info

See merge request GNOME/gtk!4169
2021-11-20 14:43:48 +00:00
Luca Bacci
48b83d3e97 Merge branch 'win32-egl-cleanup' into 'master'
GDK-Win32: Port EGL code to newer common GDK code

See merge request GNOME/gtk!4040
2021-11-19 08:42:40 +00:00
Chun-wei Fan
b801125797
GDK-Win32: Fix AeroSnap indicator and positioning
Ensure that we take the DPI scaling into account so that surfaces will
be placed at their correct positions upon an AeroSnap operation on HiDPI
displays.

Also, use the X coordinate of the surface as-is during snap up so that
we do not inadvertently move the surface to the very left.  Also fix the
AeroSnap indicator drawing for snap up so that it is drawn at the
correct places.

Since we are updating these functions, make the old GdkWindow-era
variable names to match better the names we use nowadays.
2021-11-18 12:40:57 +01:00
Jonas Ådahl
b9bdbe9aae 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:15:40 +01:00
Bilal Elmoussaoui
40c08954db g-i: add missing since annotations 2021-11-13 17:50:53 +01:00
Ian Douglas Scott
1c6608f426 gdk/wayland/surface: Remove unused argument 2021-11-08 14:46:38 -08:00
Ian Douglas Scott
fcdc5538cf gdk/wayland/surface: Move *idle_inhibitor* to GdkWaylandToplevel 2021-11-08 14:46:34 -08:00
Ian Douglas Scott
dd327bc8a6 gdk/wayland/surface: Move *exported to GdkWaylandToplevel 2021-11-08 14:43:19 -08:00
Ian Douglas Scott
b878353f0b gdk/wayland/surface: Move server_decoration to GdkWaylandToplevel 2021-11-08 14:00:00 -08:00
Luca Bacci
9f9479a50f Merge branch 'forward-port-mr-3931-to-gtk4' into 'master'
Remove the GdkWin32 global screen offset

Closes #4348 and #1477

See merge request GNOME/gtk!4104
2021-11-08 18:55:07 +00:00
Chun-wei Fan
41599e5e90 GDK-Win32: Make EGL a runtime opt-in
Use the debug envvar 'GDK_DEBUG=gl-egl' to determine whether we want to try to
initialize EGL first before trying WGL, as a means for people to more easily
enable EGL support on Windows to test EGL there (such as to debug the shaders,
for instance)
2021-11-08 15:40:59 +08:00
Chun-wei Fan
1b2e69f6c0 GDK-Win32: Realize EGL using common realization code
This will clean up the EGL code in GDK-Win32, as well as fixing crashes caused
by using an invalid EGL context in gdk_gl_context_make_current() as we did not
store up the EGL context in the correct place (lost during the transition to
the common EGL initialization code).

On the Windows/libANGLE side, the initialization of EGL has now fully moved to
the common code in GDK, but we will still default on WGL for now.  Help is
really appreciated for fixing the shaders on libANGLE!
2021-11-08 15:40:49 +08:00