Commit Graph

72759 Commits

Author SHA1 Message Date
Mat
3ecb30353a Revert "treepopover: Do not propagate natural width of content"
This reverts commit cde32368f0.
2022-10-06 19:09:13 +03:00
Matthias Clasen
f464307f61 Merge branch 'wip/headless-infinite-bounds-4-6' into 'gtk-4-6'
[4.6] Fix shrinking windows on suspend/resume

See merge request GNOME/gtk!5089
2022-10-06 10:42:35 +00:00
Jonas Ådahl
92a74adc8c toplevel-size: Report zero bounds as infinite
Empty/zero bounds are sent by the Wayland compositor if there are no
valid bounds to report, e.g. if there are no connected monitors. Report
this to GTK, which uses this to clamp calculated sizes, as INT_MAX, so
that clamping isn't done until there are actual valid bounds to clamp
to.

This fixes clients sometimes shrinking to their minimum size during
hotplugs or after having suspended the session.

(cherry picked from commit b3a3a6ceb1)
2022-10-06 10:39:08 +02:00
Jonas Ådahl
0b312d878c surface/wayland: Handle no current monitor when calculating bounds
We shouldn't assume there is always a monitor to derive bounds from.
If there is no monitor, pass empty bounds, as this matches what
xdg_toplevel.configure_bounds do in this case.

(cherry picked from commit 148c133674)
2022-10-06 10:39:03 +02:00
Jürgen Benvenuti
4b5877972e Update German translation 2022-10-05 18:58:36 +00:00
Мирослав Николић
6ba7b4ad73 Update Serbian translation 2022-10-03 04:15:53 +00:00
Goran Vidović
0c3056b649 Update Croatian translation 2022-10-02 14:12:06 +00:00
Aleksandr Melman
b4ba384d68 Update Russian translation 2022-10-01 15:41:20 +00:00
Goran Vidović
bce7b5807a Update Croatian translation 2022-09-30 12:13:47 +00:00
Goran Vidović
7b15830fbc Update Croatian translation 2022-09-30 12:07:44 +00:00
Balázs Úr
d40e55cf88 Update Hungarian translation 2022-09-29 16:41:45 +00:00
Goran Vidović
acd47daa3b Update Croatian translation 2022-09-29 12:07:24 +00:00
Goran Vidović
0b7bf4c5d0 Update Croatian translation 2022-09-29 12:03:39 +00:00
Matthias Clasen
586dcb94d6 Merge branch 'cherry-pick-4.6' into 'gtk-4-6'
Cherry-pick changes from main for gtk-4-6

See merge request GNOME/gtk!5065
2022-09-29 10:25:47 +00:00
Carlos Garnacho
5db8a550db gdk/wayland: Drop surface checks on wl_pointer.leave handling
Even though the argument is non-nullable, GTK sometimes incurs in that
by itself by destroying the surface while the event is in flight. This
is the case of popping down a GtkDropdown. When this happens we simply
ignore the crossing event, but we should let it through instead, the
compositor did not send it in vain and we possibly still have pointer
state to undo.

Drop the surface checks, so that the event is propagated along GTK.
2022-09-29 01:58:02 +03:00
Carlos Garnacho
06afb5d354 gtkimcontextwayland: Shuffle full resets after IM changes
Doing reset() on the text widgets after commit and delete_surrounding
is still too eager for some IMs (e.g. those that expect being able
to commit text while keeping a preedit buffer shown).

However, reset() is more of a "synchronize state" action on Wayland,
and it is still desirable to do that after changes that do come from
the IM (e.g. requesting the new surrounding text and cursor/anchor
positions). Notably here, the text_input protocol may still come up
with a preedit string after this state synchronization happens.

Shuffle the code so that the text widgets do not reset() the IM
context after text is deleted or committed, but the Wayland IM does
apply its practical effects after these actions happen. This keeps
the Wayland IM fully up-to-date wrt text widget state, while not
altering the ::commit and ::delete-surrounding-text behavior for
other IM context implementations.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5200
Fixes: 5b78fe2721 (gtktextview: Also reset IM context after IM...)
Fixes: 7c0a395ff9 (gtktext: Also reset IM context after IM...)
Fixes: 52ac71b972 (gtktextview: Shuffle the places doing IM reset)
Fixes: 9e29739e66 (gtktext: Shuffle the places doing IM reset)
2022-09-29 01:58:02 +03:00
Simon McVittie
42a309f1a5 gdkevents: Don't ignore modifiers that are not currently active
The X11 backend can mark modifiers like Shift as consumed even if they
aren't actually active, which seems to be something to do with making
shortcuts like `<Control><Shift>plus` and `<Control>plus` work as
intended regardless of whether the plus symbol is obtained by pressing
Shift and a key (like `+/=` on American, British or French keyboards)
or not (like `*/+` on German keyboards).

However, this can go badly wrong when the modifier is *not* pressed.
For example, terminals normally have separate bindings for `<Control>c`
(send SIGINT) and `<Control><Shift>c` (copy). If we disregard the
consumed modifiers completely, when the X11 backend marks Shift as
consumed, pressing Ctrl+c would send SIGINT *and* copy to the clipboard,
which is not what was intended.

By masking out the members of `consumed` that are not in `state`, we
get the same interpretation for X11 and Wayland, and ensure that
keyboard shortcuts that explicitly mention Shift can only be triggered
while holding Shift. It continues to be possible to trigger keyboard
shortcuts that do not explicitly mention Shift (such as `<Control>plus`)
while holding Shift, if the backend reports Shift as having been
consumed in order to generate the plus keysym.

Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/5095
Bug-Debian: https://bugs.debian.org/1016927
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-09-29 01:58:02 +03:00
Matthias Clasen
e92e4c5728 portal: Use the right mimetype for file transfers
The filetransfer protocol says to use
application/vnd.portal.filetransfer, but I used
application/vnd.portal.files when I implemented the
protocol. Oops.

This commit dds the correct mimetype, but we still
support the old one to preserve interoperatibility
with existing flatpaks using GTK 4.6.

Fixes: #5182
2022-09-29 01:58:02 +03:00
Corey Berla
8d771eb26c gridview: Fix rubberbanding from negative x coordinates
This is a follow-up to 1e9a36ffa8. For GridView
we also need to make sure that we aren't rubberbanding below x=0 which
causes unexpected rubberbanding behavior.

Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2492
2022-09-29 01:58:02 +03:00
Matthias Clasen
7aab4acecc filechooser: Restore ~ and . functionality
We'll have to keep patching up these things
until somebody rewrites the file chooser :(

Inspired by: !4970
2022-09-29 01:58:02 +03:00
Matthias Clasen
23d8b6063c Handle absence of portals
When the documents portal is not on the bus,
we still get an (unowned) proxy, and we need
to handle that situation.
2022-09-29 01:17:51 +03:00
Matthias Clasen
af831e488b portals: Fix FileTransfer portal calls
We were not passing the right arguments to
the AddFiles call, causing the file transfer
to fail.
2022-09-29 01:17:35 +03:00
Matthias Clasen
11e90e4fa0 Make the file transfer portal setup sync again
We need to register the portal mime types before
the others to prefer them, doing this call async
messes up that ordering.

This is effectively reverting 69fb3648b2
2022-09-29 01:17:12 +03:00
Matthias Clasen
0b200e393f Stop recursion in registering serializers
This was probably unintentional, and messes up
the ordering of our registration.
2022-09-29 01:16:36 +03:00
Hugo Carvalho
a18f52b7d4 Update Portuguese translation 2022-09-28 13:18:13 +00:00
Aurimas Černius
65e6846500 Updated Lithuanian translation 2022-09-27 22:22:36 +03:00
Rafael Fontenelle
eabe4fd79b Update Brazilian Portuguese translation 2022-09-27 13:08:07 +00:00
Martin
bdac484224 Update Slovenian translation 2022-09-27 08:47:01 +00:00
Piotr Drąg
dcbba58487 Update Polish translation 2022-09-26 17:59:35 +02:00
Anders Jonsson
e0c3d09e50 Update Swedish translation 2022-09-26 15:59:15 +00:00
Yuri Chornoivan
cf11438f2f Update Ukrainian translation 2022-09-26 15:54:28 +00:00
Matthias Clasen
64891e11d4 Merge branch 'backport-4577' into 'gtk-4-6'
Make the presentation of the stack sidebar listbox nicer for A11Y

See merge request GNOME/gtk!5056
2022-09-26 15:50:34 +00:00
Lukáš Tyrychtr
447d79d908 Make the presentation of the stack sidebar listbox nicer for A11Y
This backports the fix for #4577.
2022-09-26 17:32:13 +02:00
Marek Černocký
d7dbefa664 Updated Czech translation 2022-09-23 16:22:15 +02:00
Christian Kirbach
3d4685fca3 Update German translation 2022-09-18 12:28:27 +00:00
Martin
ff83daa700 Update Slovenian translation 2022-09-18 11:08:34 +00:00
Emin Tufan Çetin
0ed327ba0e Update Turkish translation 2022-09-18 08:23:28 +00:00
Matthias Clasen
5fe9faf2e3 Merge branch 'cherry-pick-4.6' into 'gtk-4-6'
Cherry-pick changes from main for gtk-4-6

See merge request GNOME/gtk!5025
2022-09-12 23:33:54 +00:00
Matthias Clasen
7b15c68cd0 emojichooser: Fix arrow keynav
When some of the Emoji have been filtered out by
a search term, arrow keynav would behave oddly and
get stuck in invisible sections. Fix this by ignoring
any filtered out children when moving between
sections for arrow keynav.

Fixes: #5076
2022-09-12 23:00:00 +03:00
Matthias Clasen
75fed298b8 Add a test for treelistmodel row collapse
Test that we can expand and collapse a row, and then
add another child below it, without crashing.

Adapted from the testcase in #4595.

This tests the fix in the previous commit.
2022-09-12 22:58:11 +03:00
Matthias Clasen
d21112a3ce treelistmodel: Fix handling of collapsed nodes
When we collapse a node, we clear out the children,
but we were not disconnecting the signal handler on
the child listmodel, leading to bad outcomes when
that model is persistent and changing.

Fixes: #4595
2022-09-12 22:57:53 +03:00
Carlos Garnacho
083d023b6b gtkwindow: Use pointer-oriented function to deal with crossing events
Commit adba0b97 fixed missed pointer crossings by using a helper function that
was already present and looked like did everything that was needed. However
this function was oriented to keyboard focus and it also did update the related
widget state. Doing these changes on pointer-based crossing was misuse, and
could cause weird interactions with keyboard focus management.

Fix this by using gtkmain.c gtk_synthesize_crossing_event() that is in fact
oriented to pointers.

Fixes: adba0b97 (gtkwindow: Synthesize pointer crossing events on state changes)
Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5094
2022-09-12 22:49:57 +03:00
Georges Basile Stavracas Neto
89fc4efe6f paned: Warn if child is not actually a child
This will at least allow us to debug this in the future.
2022-09-12 22:49:13 +03:00
Georges Basile Stavracas Neto
7604eb1e39 paned: Protect against NULL variable
The inner loop in gtk_paned_set_focus_child() tries to find the
topmost GtkPaned, however, if the `w` variable ends up becoming
NULL after bubbling up the entire GtkWidget hierarchy, this loop
never breaks.

Check for NULL in this loop.

Closes https://gitlab.gnome.org/GNOME/gtk/-/issues/5094
2022-09-12 22:48:50 +03:00
Carlos Garnacho
fda50855c6 gtkmain: Pass coordinates when synthesizing pointer events
Instead of passing an event and figuring out coordinates from it, pass
directly the toplevel coordinates so that we can use this outside event
handling.

All callers have been updated to pass the coordinates, in practical effects
they were already based on the GtkNative.
2022-09-12 22:48:38 +03:00
Carlos Garnacho
dd82df9e32 gtkwindow: Synthesize pointer crossing events on state changes
When widgets go mapped/unmapped, we repick but don't generate crossing
events. Since there could be stateful controllers that use those in
the previously picked widget (e.g. GtkEventControllerMotion), skipping
those breaks their state.

Ensure to send the relevant crossing events on every situation that
changes the pointer focus, so these controllers get a fair opportunity
to undo their state.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2877
2022-09-12 22:47:46 +03:00
Carlos Garnacho
1a459c5dcd gtktextview: Also reset IM context after IM surrounding text deletion
When the IM commands the GtkText to delete text, the cursor position
would change, and so would the surrounding text. Reset the IM context
so that these updates are properly picked up by the IM.

Fixes backspace	key behavior in	the GNOME Shell OSK, since that	relies
on the surrounding text	being properly updated for the next iteration.
2022-09-12 22:42:15 +03:00
Carlos Garnacho
735f803c2f gtktext: Also reset IM context after IM surrounding text deletion
When the IM commands the GtkText to delete text, the cursor position
would change, and so would the surrounding text. Reset the IM context
so that these updates are properly picked up by the IM.

Fixes backspace key behavior in the GNOME Shell OSK, since that relies
on the surrounding text being properly updated for the next iteration.
2022-09-12 22:42:01 +03:00
Carlos Garnacho
452d93c7ea gtktext: Avoid early IM reset on updates
Resetting the IM on IM updates is too eager and indeed the simple
IM context doesn't like that this happens in the middle of dead
key handling.

We however want to reset the IM after actual text buffer changes
(say, a committed string) moved the cursor position, altered the
surrounding text, etc. So that the IM implementation does know to
update its state.

Since there is going to be an actual IM reset anyways, it does
no longer make sense to try to preserve the old priv->need_im_reset
status during commit handling.

Fixes: 52ac71b972 ("gtktextview: Shuffle the places doing IM reset")
Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5133
2022-09-12 22:41:45 +03:00
Carlos Garnacho
c4f5358826 gtktext: Avoid early IM reset on updates
Resetting the IM on IM updates is too eager and indeed the simple
IM context doesn't like that this happens in the middle of dead
key handling.

We however want to reset the IM after actual text buffer changes
(say, a committed string) moved the cursor position, altered the
surrounding text, etc. So that the IM implementation does know to
update its state.

Fixes: 9e29739e66 ("gtktext: Shuffle the places doing IM reset")
Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5133
2022-09-12 22:41:27 +03:00