Commit Graph

7939 Commits

Author SHA1 Message Date
Matthias Clasen
ff892684c8 wayland: Don't crash on cursor size 0
The cursor-theme-size setting is documented as
'0 means the default size'. Make it so by using
size 24 if we see a 0. Its better than crashing.

Fixes: #5700
(cherry picked from commit 7adbbe6f35347b19319d9e4ce8c92fb0e861524b)
2023-03-28 18:38:34 +02:00
Gaël Bonithon
a40126e1f9 gdkscreen-wayland: Notify initial setting change from org.gtk.Settings 2023-03-27 22:08:59 +02:00
Emmanuele Bassi
bda80c4e41 docs: Try to steer people away from gdk_pixbuf_get_from_window()
It's a bad function, and people should feel bad about using it.
2023-03-26 15:59:14 +01:00
Emmanuele Bassi
789d202720 gdk: Swap Cairo calls when reading back from a GdkWindow
First we flush the surface, then we mark it dirty.

Don't look at me: this makes sense in Cairo, apparently.

Fixes: #5691
2023-03-26 15:57:56 +01:00
John Ralls
33fd9eb472 [quartz] Convert frame_link, windows_awaiting_frame to GSList.
We were't using GList's prev member; worse, we weren't setting it
and that broke g_list_remove_link so that the link wasn't removed
in _gdk_quartz_display_remove_frame_callback.

Closes #5593
2023-03-23 11:44:33 -07:00
Luca Bacci
22b091047f GdkWin32: Zero-out memory of an allocated struct
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5678
2023-03-21 10:50:09 +01:00
Luca Bacci
7776052c46 Merge branch 'check-egl-support-at-runtime' into 'gtk-3-24'
GdkWin32GLContext: Check availability of EGL at runtime

See merge request GNOME/gtk!5629
2023-03-13 17:51:03 +00:00
Luca Bacci
cf3e037e64 GdkWin32GLContext: check for EGL support at runtime 2023-03-10 15:48:05 +01:00
Chun-wei Fan
2ebf7c29e1 gdkglcontext-win32.c: Fix running under GLES
...when GDK_DEBUG=opengl is enabled.  There was an extraneous "legacy: %s" in
the GDK_NOTE (OPENGL, g_message("...")) line that should not have been there,
due to a copy-and-paste mishap.  Get rid of it.
2023-03-09 11:14:58 +08:00
Luca Bacci
20964a3fa6 Merge branch 'backport-mr-4620-to-gtk-3-24' into 'gtk-3-24'
GdkWin32: Mouse events fixes

See merge request GNOME/gtk!5493
2023-02-13 15:34:24 +00:00
Luca Bacci
53f8a2ef93 GdkWin32: Generate crossing event after button release
This is a backport of commit cb0c1b3f to gtk-3-24
2023-02-13 16:15:04 +01:00
Luca Bacci
783af2e3bf GdkWin32: Correct generation of crossing events when holding an implicit grab
This is a backport of commit 91f20016 to gtk-3-24
2023-02-13 16:14:54 +01:00
Emmanuele Bassi
fba09dbfc7 Mark surface as dirty before flushing it
If we're trying to read back the contents of a GdkWindow that was
created from a foreign windowing system surface, we are going to
forcibly mark it as dirty before flushing the Cairo state.

To avoid regressing any further in the future of the 3.x branch, let's
leave a comment.

Fixes: #5482
2023-02-12 19:19:25 +00:00
John Ralls
f931c73316 [quartz] Silence two compiler warnings.
One unused function, one return type mismatch.
2023-02-11 12:57:08 -08:00
John Ralls
312e5781f3 [quartz] Set the sRGB colorspace on the IOSurface.
Enables colorspace tranformation in Core Animation. This transform
is executed on the GPU and unlike the Core Graphics one has no
affect on performance.

Fixes #5579
2023-02-11 12:52:38 -08:00
Matthias Clasen
4fcf3b3a7d Merge branch 'gtk-3-24-focus-to-modal-parant-and-transient-for' into 'gtk-3-24'
Solution for focus loss problem for complex multi Window UI in Broadway backend

See merge request GNOME/gtk!3990
2023-02-10 11:37:49 +00:00
Alexander Mikhaylenko
384d9a75cd Revert "Revert "wayland: Add support for gtk_surface1_titlebar_gesture()""
This reverts commit 5aaa373b70
2023-01-28 09:41:34 +00:00
Matthias Clasen
b24e43a1f7 Merge branch 'revert-titlebar-gestures' into 'gtk-3-24'
Revert "wayland: Add support for gtk_surface1_titlebar_gesture()"

See merge request GNOME/gtk!5451
2023-01-28 03:03:51 +00:00
Matthias Clasen
5aaa373b70 Revert "wayland: Add support for gtk_surface1_titlebar_gesture()"
This reverts commit 45ba6e9329.

This caused regressions in libhandy-using applications.

Fixes: #5389
2023-01-27 21:34:44 -05:00
Carlos Garnacho
13647e0144 Merge branch 'fix-xdg-activation-set-surface-gtk-3-24' into 'gtk-3-24'
Backport "gdk/wayland: set requesting surface to xdg-activation" to gtk-3-24

See merge request GNOME/gtk!5398
2023-01-27 19:05:39 +00:00
Joan Bruguera
41827d9f72 gdk/wayland: set requesting surface to xdg-activation
The argument to xdg_activation_token_v1_set_surface is documented to be the
surface requesting the activation, not the surface to be activated, which is
given later when calling xdg_activation_v1_activate.
(c.f. 36cee4bdbc)

Use the same logic as in gdk_wayland_app_launch_context_get_startup_notify_id,
i.e. if we have a surface with focus, set that, otherwise set NULL.

This fixes requesting urgent/focus on wlroots (compositors like Sway, etc.),
which was blocked as the surface requesting the activation didn't have focus.

Backport of: 43c1a433aa0839826451f71029965d8e359a9178

Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
2023-01-27 14:53:41 +00:00
Matthias Clasen
9811485990 gl: Synchronize when calling MakeCurrent
When making out GL context current, wait
until the GPU is done with commands from
the previous context.

Fixes: #5517
2023-01-27 07:09:34 -05:00
Matthias Clasen
b6795f8ff9 Merge branch 'wip/carlosg/startup-vs-focus-3-24' into 'gtk-3-24'
Consider startup vs focus requests for the Wayland platform [3.24]

See merge request GNOME/gtk!5443
2023-01-25 13:09:17 +00:00
Carlos Garnacho
6ccd786a93 gdk/x11: Emit "remove" s-n message from gdk_toplevel_set_startup_id
In the way towards deprecating gdk_display_notify_startup_complete(),
make gdk_toplevel_set_startup_id() on X11 perform this piece of messaging
itself. It should be harmless that the message is emitted twice, if
callers do still use that API.

(cherry-picked from commit 7fab1b85adbddff7628e3e916f00677080fb9150)
2023-01-25 11:22:40 +01:00
Carlos Garnacho
f5a5480fe2 gdk/wayland: Perform xdg_activation on gdk_window_set_startup_id
This call has everything to perform activation as specified by the
xdg_activation protocol, notably a surface to activate as opposed to
gdk_notify_startup_complete().

Make activation happen here, so that the surface gets activated when
its gets a startup ID assigned.

(cherry-picked from commit 5aeabdb3d404579b5cab4fff1642ed116f745a8b)
2023-01-25 11:22:40 +01:00
John Ralls
f60359c183 [quartz] GdkWindow, GdkNSView frame and cairo surface same size.
The cairo surface must be padded to 4 pixels in order to
transfer correctly to the GPU. The GdkWindow and GdkNSView's
content frame must be the same width, otherwise there's a mismatch
that causes either the GdkWindow to draw wider than the frame or the
frame to be clipped narrower than the title bar.

Fixes #5535.
2023-01-19 10:37:55 -08:00
John Ralls
10689066e3 [quartz] Fix typo to call function. 2023-01-06 10:13:02 -08:00
Thomas Jost
0f55e9552f
Treat XKB_MOD_NAME_LOGO as super key
Loosely based on !5304, which fixes #4913 for GTK3.
2023-01-03 17:09:04 +01:00
Matthias Clasen
feb38ce112 Revert "Treat XKB_MOD_NAME_LOGO as super key"
This reverts commit 3a871c9184.

This broke one of our tests.
2022-12-22 09:00:37 -05:00
Ignazio Pillai
82e8605627 clipboard: improve EOL conversion of plain text
Handle the case of clipboard text with CR line endings
2022-12-22 10:26:34 +01:00
Matthias Clasen
f39dea3d57 Revert "Revert "wayland/cursor: Sanity check cursor image size""
This reverts commit 4432a03742.
2022-12-13 18:52:34 -05:00
Matthias Clasen
74bdb8d8a5 Revert "Make wayland load cursors on demand"
This reverts commit 66a199806c.
2022-12-13 18:52:29 -05:00
Matthias Clasen
89583c456d Revert "wayland: Look for cursor themes in $HOME"
This reverts commit 3f1536632f.
2022-12-13 18:51:16 -05:00
Matthias Clasen
3b9531d3d3 Merge branch 'ebassi/no-more-autotools-redux' into 'gtk-3-24'
Drop the Autotools build

See merge request GNOME/gtk!5299
2022-12-13 12:10:34 +00:00
Ross Burton
8eb4e59613 Use @basename@ in enumeration type templates
The @filename@ directive will use the full path of the file being parsed
for enumeration types; we should use @basename@, instead, as it improves
the reproducibility of the build by using only the file name.

Backport of 4040f76529bbf6d3310a71df2d37c9d95af83892 from main.
2022-12-12 13:09:53 +00:00
Matthias Clasen
efdc6b81e6 Merge branch 'issue5305' into 'gtk-3-24'
[quartz] Work around macOS 13 not sending trackingArea events.

See merge request GNOME/gtk!5280
2022-12-11 04:02:14 +00:00
John Ralls
5d91434f38 [quartz] Set GdkQuartzView wantsLayer.
Apparently wantsUpdateLayer by itself isn't sufficient.
Also #ifdef wantsUpdateLayer for macOS X 10.8 and later; earlier
versions don't provide it.

Fixes #5393
2022-12-08 10:04:56 -08:00
Matthias Clasen
c6321e52df Merge branch 'backport-mr-5088-to-gtk-3-24' into 'gtk-3-24'
Treat XKB_MOD_NAME_LOGO as super key

See merge request GNOME/gtk!5304
2022-12-08 12:14:55 +00:00
Emmanuele Bassi
2b0a605c5d build: Remove the Autotools build
CI and downstream packagers have been using the Meson build for a while
now, and we checked that it's idempotent to the Autotools build.

Having two build systems in tree doesn't make maintaining and releasing
GTK any easier, even if it's the stable/frozen branch.
2022-12-08 11:57:39 +00:00
Po Lu
3a871c9184
Treat XKB_MOD_NAME_LOGO as super key
Based on !5088. See also #4913.
2022-12-07 17:34:17 +01:00
Carlos Garnacho
eca445672a gdk/wayland: Convert selection mimetypes back to atoms, if needed
Commit 0c1ea92219 took care of converting STRING/UTF8_STRING to mimetype
strings when letting selection targets known to the outer world through
wl_data_source/zwp_primary_selection_source_v1, but it missed the conversion
of those mimetypes back to the old atom strings, depending on the
application, the mimetype counterparts might not be known or handled, so
requests to paste from this app could go ignored.

Fixes: 0c1ea92219 - wayland: Translate STRING/UTF8_STRING selection atoms to mimetypes

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5397
2022-12-07 00:49:18 +01:00
Emmanuele Bassi
b24550abc0 x11: Remove unused header file
The XInput 1.x support was removed 10 years ago.
2022-12-06 22:01:51 +00:00
Emmanuele Bassi
ec156ad5b7 broadway: Remove unused file 2022-12-06 21:57:21 +00:00
Emmanuele Bassi
7b02682b1d wayland: Fix argument's constness
The compiler was pointing out we were dropping the const modifier.
2022-12-06 21:50:30 +00:00
Emmanuele Bassi
01ac1bbaae Drop unnecessary volatile modifier
It's completely useless, and just generates compiler warnings with
recent GLib versions.
2022-12-06 21:50:30 +00:00
Emmanuele Bassi
ca1dfc7092 build: Replace deprecated get_pkgconfig_variable()
Use get_variable(pkgconfig:...) instead.
2022-12-06 20:45:58 +00:00
John Ralls
7e1a3ffa37 [quartz] Work around macOS 13 not sending trackingArea events.
Fixes #5305
2022-11-29 11:58:17 -08:00
John Ralls
ce99b56f25 [quartz] Update known and latest macOS version to macOS 13 Ventura. 2022-11-29 11:45:39 -08:00
John Ralls
307945fbe4 [quartz]Use new (since 10.5) NSTrackingArea instead of older tracking rect. 2022-11-29 10:32:19 -08:00
John Ralls
cf53a34db4 [quartz] Fix some compile warnings. 2022-11-29 10:31:39 -08:00