Commit Graph

53135 Commits

Author SHA1 Message Date
Luca Bacci
272b6b4feb GtkMenu: Take offscreen windows in account for positioning 2023-07-13 16:31:58 +02:00
Luca Bacci
3e3266dce4 GdkWindow: Check for offscreen windows in set_transient_for ()
Fixes https://gitlab.gnome.org/GNOME/gimp/-/issues/6711
2023-07-13 16:24:42 +02:00
Carlos Garnacho
fc32ff89c5 Merge branch 'wip/carlosg/switch-stylus-buttons-3-24' into 'gtk-3-24'
[3.24] gdk/wayland: Switch behavior of BTN_STYLUS/STYLUS2 as middle/right click

See merge request GNOME/gtk!6169
2023-07-06 11:11:32 +00:00
Carlos Garnacho
e205bdaa89 gdk/wayland: Switch behavior of BTN_STYLUS/STYLUS2 as middle/right click
This mapping of stylus evdev input event codes into GDK button numbers
makes gdk/wayland inconsistent with gdk/x11, so depending on the backend
the same button middle-click pastes or right-click pops up menus.

Make the wayland backend consistent with X11, so that a GNOME wayland
session gets these buttons consistently mapped across all kinds of
clients.

(cherry-picked from commit e28ff79bec53ecd56885390ba4a66019cde598c6)
2023-07-06 12:39:09 +02:00
John Ralls
e1f3ce5cce Merge Antoine Martin's MR 5648 into gtk-3-24. 2023-07-03 15:23:01 -07:00
totaam
1e1e1a1b8b make gdkquartz-cocoa-access.h usable again
There is no need to include gdkquartz.h there,
which was making it impossible to include this header file
without also adding gdk/ as an include directory when compiling.
This patch moves the include to the only location where it is actually needed.
2023-07-03 15:19:39 -07:00
Benjamin Otte
43a99b1c8e Merge branch 'wip/otte/for-gtk-3-24' into 'gtk-3-24'
Check for GLsync before using it

See merge request GNOME/gtk!6162
2023-07-01 21:32:04 +00:00
Benjamin Otte
cf7decae1a gdkgl: Check for GLsync before using it
Copy what we do in GTK4: Check for GL >= 3.2 or GLES >= 3.0 or the
GL_ARB_sync extension.
Then store that info for a (private) gdk_gl_context_has_sync()
function.
And then check that function before using GLsync objects as introduced
by commit 9811485990.

Fixes #5749
2023-07-01 22:58:28 +02:00
Bruce Cowan
f94f94af51 Update British English translation 2023-06-30 18:40:07 +00:00
Chun-wei Fan
ce20f3c6e4 Merge branch 'fix-issue-5877' into 'gtk-3-24'
GdkWin32: Use scaled coordinates for move_resize_drag()

See merge request GNOME/gtk!6132
2023-06-30 04:06:58 +00:00
Luca Bacci
6f12c9c5de GdkWin32: Fix warning due to changed device count 2023-06-27 15:53:14 +02:00
Luca Bacci
04b0cc70c1 WinPointer: Actually destroy GdkDeviceTools 2023-06-27 15:48:35 +02:00
Jordi Mas
0fa2ff5511 Update Catalan translation 2023-06-22 21:02:10 +02:00
Luca Bacci
6d0f34103d GdkWin32: Use scaled coordinates for move_resize_drag()
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5877
2023-06-21 17:00:00 +02:00
Matthias Clasen
7141305972 Merge branch 'wip/carlosg/pad-detection-3-24' into 'gtk-3-24'
Pad detection fixes (3.24)

See merge request GNOME/gtk!6095
2023-06-14 00:10:23 +00:00
Carlos Garnacho
a9d7198d63 gdk/wayland: Return pad devices querying for all devices
These devices unfortunately didn't ever get a capability flag in
3.24 (fixed in GTK4). We are very far off into maintenance grounds that
it is not ideal to add new flag values, but we could however return
these devices if GDK_SEAT_CAPABILITY_ALL is being asked.

Do that, so it is possible to deal with pad devices, even if it's
not possible to query them specifically.
2023-06-14 00:33:12 +02:00
Carlos Garnacho
81029b824b gdk/wayland: Ensure device-added/removed emission in GdkSeat
We've used to emit these in the GdkDeviceManager, but missed to do
this signal emission at the GdkSeat object level. In order to avoid
the double emission, trigger one from the other.
2023-06-14 00:33:12 +02:00
Carlos Garnacho
6070f10922 gdk/wayland: Create pad devices on enter
We were creating the pad device on wp_tablet_pad.done, but
at that time we do not know what tablet it is associated with,
thus we cannot get appropriate vid/pid/name properties for it.

To get that, we need to wait for the pad to enter a surface,
at that time we do know what tablet it is associated with, so
we can get better information about the device.

There are pads that may plausibly "change" tablet between
one .enter event and the next (e.g. Wacom Express Key Remote),
but this situation is highly unlikely. The pad devices created
are thus persistent until that situation happens.
2023-06-14 00:33:12 +02:00
Dušan Kazik
4d9ca4e0b6 Update Slovak translation 2023-06-13 12:10:56 +00:00
Daniel Rusek
eb379bfdd7 Update Czech translation 2023-06-12 13:15:19 +00:00
Daniel Boles
a6d40b610b Popover: Clarify/guard out rect of get_pointing_to
Clarify that we zero out the widget coords and only keep its dimensions.

If we have no widget to fall-back to, memset to 0 the output @rect since
we return FALSE whether or not we have widget, so protect users from not
knowing if there was a widget and possibly accessing uninitialised ints.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/893#note_1766079
2023-06-11 11:37:45 +01:00
Timm Bäder
ad07e9043f popover: Remove useless if case
rect is not nullable, so stop checking if it is NULL and instead add a
g_return_val_if_fail guard.
2023-06-11 11:26:33 +01:00
Daniel Boles
c9f0b0d29b ScrolledWindow: Frame on viewport is not optional,
and seems always to default to true, so don't mention it being optional.
2023-06-11 11:22:45 +01:00
Matthias Clasen
6803508442 Merge branch 'gtk-3-24' into 'gtk-3-24'
gtkmountoperation: avoid SEGV after bad password input

See merge request GNOME/gtk!6049
2023-06-02 14:57:10 +00:00
Martin Wilck
1d95b8ab26 gtkmountoperation: avoid SEGV after bad password input
I observed the following nautilus crash below after trying to access an SMB
share and mistyping my password (it also happens if mounting the SMB share
fails for other reasons after entering a password). The crash happens when
the password entry window pops up the second time, in this code path, at
the 7th element of priv->user_widgets:

458	pw_dialog_anonymous_toggled (GtkWidget         *widget,
459	                             GtkMountOperation *operation)
460	{
...
472	  for (l = priv->user_widgets; l != NULL; l = l->next)
473	    {
474	      gtk_widget_set_sensitive (GTK_WIDGET (l->data), !priv->anonymous);
475	    }

The broken element had l->data = 0xaaaaaaaaaaaa, which means the pointer had
been freed.

The broken list entries were at the of the list because when
gtk_mount_operation_ask_password_do_gtk() constucts the pop-up the 2nd time,
it prepends new widgets:

gtk_mount_operation_ask_password_do_gtk()
   table_add_entry
       operation->priv->user_widgets = g_list_prepend (operation->priv->user_widgets, entry);

The problem is that in pw_dialog_got_response(), the widget is destroyed,
which also destroys all child widgets, but the priv->user_widgets list is
neither freed nor set to NULL.

Fix it.
2023-06-02 16:30:28 +02:00
Matthias Clasen
0f990e8157 Merge branch 'gtk-3-24+trap-bad-rr-errors' into 'gtk-3-24'
[GTK3] x11: Trap XRandr errors when getting outputs during init and update

See merge request GNOME/gtk!6047
2023-06-02 11:32:04 +00:00
Marco Trevisan (Treviño)
b938e4e6ac x11: Trap XRandr errors when getting outputs during init and update
We may try to update the XRR outputs and Crtcs when they're changing in
the server, and so we may get BadRROutput that we're currently not
handling properly.

As per this, use traps and check whether we got errors, and if we did
let's ignore the current output.

It's not required to call init_randr13() again because if we got errors
it's very likely that there's a change coming that will be notified at
next iteration during which we'll repeat the init actions.
2023-06-02 00:31:44 +02:00
Matthias Clasen
06bf07bed3 Merge branch 'fix-slow-perf-x11-gl' into 'gtk-3-24'
Remove slow and unnecessary X11 code-path when using OpenGL functionality

See merge request GNOME/gtk!6042
2023-06-01 10:55:25 +00:00
henry
7237f5d0eb This commit fixes a performance issue on X11 systems in regards to drawing on an OpenGL surface in GTK/GDK.
This commit fixes a performance issue on X11 systems making use of the gdk_cairo_draw_from_gl() function in regards
to drawing on an OpenGL surface in GTK/GDK. Specifically, this fix removes the slow X11 codepath that was used when
executing the gdk_cairo_draw_from_gl() function because it was completely uneeded. I tested the before and after on
Flutter and GTK apps making use of the OpenGL rendering and can confirm that there is no behaviour and visual
difference. This change is also specific to drawings that make use of textures. The render buffer code path has
been left completely unmodified.

Closes #4704
2023-05-31 23:05:19 +01:00
Matthias Clasen
94001d49bf Merge branch 'gtk-3-24' into 'gtk-3-24'
Fix a typo

See merge request GNOME/gtk!6040
2023-05-31 14:49:39 +00:00
liulinsong
1659cefde7 Fix a typo
1. According to the UTF-8 spec, ASCII character's charcode is from
   0 to 127 inclusively.

2. Any charcode which is greater than or equal to 128 will be
   a multi-byte character.
2023-05-31 22:13:53 +08:00
Sabri Ünal
379512c092 Update Turkish translation 2023-05-29 12:18:38 +00:00
Matthias Clasen
8faa85f576 Merge branch 'gtk-3-24' into 'gtk-3-24'
Make sure that the charcode is signless

See merge request GNOME/gtk!6030
2023-05-29 11:11:20 +00:00
liiulinsong
6dc75b46cc Make sure that the charcode is signless
1. The data with type of char is signed by default.

2. The byte value of UTF-8 is signless by default.

3. So, if a UTF-8 charcode is stored in a char array, we should cast the
type of its value from char to unsigned char.
2023-05-29 09:52:38 +08:00
Matthias Clasen
c00f1a96c8 Merge branch 'backport-ftw-struct' into 'gtk-3-24'
Backport "Use correct stat struct for ftw()"

See merge request GNOME/gtk!6004
2023-05-22 10:05:53 +00:00
Руслан Ижбулатов
7e17693cce Use correct stat struct for ftw()
check_dir_mtime() is called by ftw() and is given
the real stat struct, not its glib version (which may
or may not be the same as "struct stat").

This is irrelevant for MSVC (it has no ftw()) and
works correctly for MinGW-w64 (which declares stat
structures correctly). If mingw.org complains, add
a special ifdef for it later.
2023-05-22 07:52:01 +02:00
Matthias Clasen
3ce4f4ea78 Post-release version bump 2023-05-21 22:24:57 -04:00
Matthias Clasen
3e6fd55ee0 3.24.38 2023-05-21 22:22:08 -04:00
Matthias Clasen
f1602ef833 Disable a few failing reftests 2023-05-21 22:22:08 -04:00
Leônidas Araújo
0e3cb4b84d Update Brazilian Portuguese translation 2023-05-15 12:30:13 +00:00
Gianvito Cavasoli
294249a8bd Update Italian translation 2023-05-14 10:38:47 +00:00
John Ralls
32e5c18213 [quartz] Pad both the content rect and the window width.
Otherwise the rastering gets messed up and popup windows get badly
truncated lengthwise on non-Retina monitors when there are both
Retina and non-Retina monitors.
2023-05-09 15:39:10 -07:00
John Ralls
acb183ef7c [quartz] Remove unused variable. 2023-05-09 13:58:22 -07:00
John Ralls
ddf984f42c Finally resolve gdkquartz.h include path issue.
By using a different include path for building Gtk.
2023-05-09 13:51:28 -07:00
Matthias Clasen
90472dc481 Merge branch 'application-signal-cleanup-for-3' into 'gtk-3-24'
Fix a crash

See merge request GNOME/gtk!5887
2023-04-29 11:28:00 +00:00
Matthias Clasen
a76ae3eb85 Fix a crash
Fix an oversight from fc1643956b.
2023-04-29 06:40:50 -04:00
Matthias Clasen
de1660132e Merge branch 'application-signal-cleanup-for-3' into 'gtk-3-24'
application: Clean up signal handlers

See merge request GNOME/gtk!5871
2023-04-26 12:38:22 +00:00
Matthias Clasen
fc1643956b application: Clean up signal handlers
This is the right thing to do and might help for #5775.
2023-04-26 14:09:44 +02:00
Yosef Or Boczko
2a7877277e Update Hebrew translation 2023-04-21 09:12:18 +00:00
Fran Dieguez
4986c622c1 Update Galician translation 2023-04-13 16:57:52 +00:00