Compare commits

...

149 Commits

Author SHA1 Message Date
Marek Černocký
770e5460d2 Update Czech translation 2023-03-06 11:59:19 +00:00
Matthias Clasen
2c5784977a Merge branch 'revert-undo-4-8' into 'gtk-4-8'
[4.8] Revert "text: Make editable API irreversible"

See merge request GNOME/gtk!5578
2023-03-01 12:28:02 +00:00
Mat
6c88cc7215 Revert "text: Fix disabling of history"
This reverts commit 45d6ffcce8.
2023-03-01 14:06:16 +02:00
Mat
ea1bb79566 Revert "text: Make editable API irreversible"
This reverts commit 08479ae4b2.
2023-03-01 14:04:34 +02:00
Matthias Clasen
d0e3dc7ce0 Merge branch 'textbuffer-foreground-property-4-8' into 'gtk-4-8'
[4.8] textbuffer: Use correct foreground color property

See merge request GNOME/gtk!5575
2023-03-01 11:05:08 +00:00
Matthias Clasen
fec951c2b2 Merge branch 'cherry-pick-4-8' into 'gtk-4-8'
Cherry-pick changes from main for 4.8

See merge request GNOME/gtk!5573
2023-03-01 11:04:13 +00:00
Lukáš Tyrychtr
d84dab39b9 Don't tell the screen reader that a button is related to an image which has no useful label 2023-03-01 06:24:35 +02:00
Mat
40ff1f442b textbuffer: Use correct foreground color property
The 'foreground-rgba' property should be used instead of 'foreground',
since the latter is not readable.
2023-03-01 04:49:44 +02:00
Corey Berla
c8b4f0c8e8 columnviewtitle: Prevent header clicks from propagating
The header in GtkColumnView has multiple event handlers
there is a ::pressed handler in GtkColumnView for
resizing the columns in CAPTURE as well as a motion
and drag controller.  The ::release handler is in
GtkColumnViewTitle.   We can't claim the event in the
existing handlers because then the ::release handler will
never get called.  Currently, however, all clicks get propagated
to the ColumnView from the header which can be problematic.
Since we don't usually want the clicks from the header
handled on the view, claim it in the BUBBLE phase.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5425
2023-03-01 01:38:18 +02:00
Alexander Mikhaylenko
52f7afeecd builderparser: Don't exit too early on nested custom tags
Currently nested custom tags work only as long as the element names differ
from the root one. If it's same, for example:

<condition type="any">
  <condition type="max-width">600</condition>
  <condition type="max-height">600</condition>
</condition>

then it will fail. Meanwhile the same tags wrapped into <conditions> would
work.

The problem is that custom tag parsing is considered finished as soon as we
encounter a closing tag with the same element name. So instead, track the
nesting level.
2023-03-01 01:20:48 +02:00
Ivan Molodetskikh
370ab8aa52 widget: Reset alloc_needed_on_child before allocating children
Reset alloc_needed_on_child *before* allocating the children. This is
because some child's size_allocate() may call queue_allocate(), which
will bubble up alloc_needed_on_child. An example of this happening is
with GtkScrollable implementations, which are supposed to configure
their adjustments in size_allocate(), which will cause GtkScrollbar's
GtkRange to notice and queue_allocate() on itself.

If we reset alloc_needed_on_child after this happens, then our children
will have a lingering alloc_needed_on_child and will not receive an
allocation.

This commit fixes widgets occasionally losing an allocation when this
scenario happens.
2023-03-01 01:20:17 +02:00
Matthias Clasen
08479ae4b2 text: Make editable API irreversible
Programmatic changes to the entry contents should
not become part of the undo history.

Sadly, the editable implementations are also used
in the code paths that we use for user-initiated changes,
so we have to be careful to only set them as
irreversible if we are not already in a user action.

Fixes: #5622
2023-03-01 01:19:54 +02:00
Matthias Clasen
45d6ffcce8 text: Fix disabling of history
Keep a separate boolean for enable-undo, and
disable the history if it is false, or the entry
is not using visible text, or isn't editable.

Related to: #5622
2023-03-01 01:19:34 +02:00
Lukáš Tyrychtr
f3b09a8725 GtkNotebook: Improve the labels of notebook pages for a11y 2023-03-01 01:18:05 +02:00
Matthias Clasen
d6d5a22306 filechooser: Fix paned limits
The intention of the ui file was to not let
the paned shrink both children down to nothing,
but using <child> for the children effectively
overrides the setting of the shrink properties.
Fix that by using child properties instead of
<child>.
2023-03-01 01:17:50 +02:00
Carlos Garnacho
512dec54d3 gdk/x11: Also grab keyboard during XDnD grabs
The drag source must handle events and messaging, this also
includes keyboard handling for accessibility and cancellation.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5604
2023-03-01 01:15:26 +02:00
Alexandros Theodotou
5cf5b9c7f5 Remove timeout when disposing GtkEditableLabel
Fixes: #5584
2023-03-01 01:11:46 +02:00
Matthias Clasen
c4ddf47d8f placessidebar: Make all rows ellipsize
Otherwise, we end up with a single long row
pushing the content of all the other rows
off to the left, which is much worse than
ellipsizing.

Fixes: #4710
2023-03-01 01:10:38 +02:00
Arjan Molenaar
fb36c167e1 wayland: Fix button mask for button 2 and 3
Wayland and GTK order mouse button 2 and 3 differently.

Fixes #5561.
2023-03-01 01:09:24 +02:00
Arjan Molenaar
d221d314b5 Allow all mouse buttons to be used for the drawingarea demo
So we can test if the drag gesture works with all mouse buttons.
2023-03-01 01:09:10 +02:00
Matthias Clasen
069fef6f99 passwordentry: Fix an asymmetry
When connecting a signal in realize,
we should disconnect in unrealize.

Fixes: #5285
2023-03-01 01:06:14 +02:00
Matthias Clasen
5caecf16ac tooltip: Prevent too-wide tooltip windows
Set the label to expand, so it actually fills
the width that we allocated for it, instead
of shrinking back to the minimum width for
its height.

Fixes: #5521
2023-03-01 01:05:45 +02:00
Matthias Clasen
8203b69e74 tooltip: Don't play games with max-width-chars
Setting max-width-chars to the number of characters
in the string works ok only as long as the average
char width we get from Pango matches reality. Sadly
that seems not always the case, and this code was
causing short Chinese tooltips to always be broken
into two lines.

Fixes: #4470
2023-03-01 01:05:27 +02:00
Sophie Herold
189c1dd306 scrolledWindow: Propagate event for no scrolling 2023-03-01 01:00:06 +02:00
Christian Hergert
a4512a4c95 istring: fix istring_prepend() on malloc transition
When transitioning from internal to malloc, the strings were placed in
the wrong order to g_strconcat(). This fixes an issue with undo where
if you hit the boundary in just the right way, your undo stack will do
unexpected things.

Fixes #5506
2023-03-01 00:53:03 +02:00
Corey Berla
ce01d7d7a3 gtkmodelbutton: Ensure that accel label is always aligned to end
When the model button just has a text label and accel text,
the button fills and the accel label is implicitly aigned to end.
When there's also a icon, even though it's not shown (because
icons are only shown if there's no text), the button doesn't fill
and the accel ends up not aligned (assuming one of the other buttons
is longer). Ensure that the accel label is aligned to the end.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5504
2023-03-01 00:51:30 +02:00
Barnabás Pőcze
a4758db75e a11y: Use fallback logic when GApplication has no DBus object path
Use the fallback logic to generate the base path for the GtkAtSpiRoot
if the GApplication has no DBus object path to guarantee that
the base path will not stay NULL.
2023-03-01 00:51:00 +02:00
Barnabás Pőcze
6a991cf05a a11y: Check if path is NULL when removing from cache
`gtk_at_spi_cache_add_context()` checks if the GtkAtSpiContext's path
is NULL before inserting the context object into the hash table.
Do the same in `gtk_at_spi_cache_remove_context()` to avoid a NULL
pointer dereference in `g_str_hash()` during the hash table lookup
if a context with NULL path is removed. That can happen when the
GtkAtSpiRoot::base_path is NULL, which, in turn, can happen if
`g_application_get_dbus_object_path()` returns NULL.

  ==394047==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fd1966f8b84 bp 0x7fff11e3ded0 sp 0x7fff11e3de58 T0)
  ==394047==The signal is caused by a READ memory access.
  ==394047==Hint: address points to the zero page.
      #0 0x7fd1966f8b84 in g_str_hash (/usr/lib/libglib-2.0.so.0+0x37b84)
      #1 0x7fd1966f9c09 in g_hash_table_contains (/usr/lib/libglib-2.0.so.0+0x38c09)
      #2 0x7fd196062c10 in gtk_at_spi_cache_remove_context ../gtk/a11y/gtkatspicache.c:447
      #3 0x7fd19606e0a9 in gtk_at_spi_root_unregister ../gtk/a11y/gtkatspiroot.c:653
      #4 0x7fd196067f58 in gtk_at_spi_context_unrealize ../gtk/a11y/gtkatspicontext.c:1559
      #5 0x7fd195ced97f in gtk_at_context_unrealize ../gtk/gtkatcontext.c:668
      #6 0x7fd195f5576e in gtk_widget_unroot_at_context ../gtk/gtkwidget.c:2399
      #7 0x7fd195f55bd2 in gtk_widget_unroot ../gtk/gtkwidget.c:2499
      ...
2023-03-01 00:50:49 +02:00
robxnano
0c83807a5a filechoosernativewin32: Set default extension 2023-03-01 00:49:42 +02:00
Corey Berla
254eca269a calendar: Set marked days immediately
The marked days are set only as part of gtk_calendar_select_day().
This is insufficient, especially because the day-selected signal
is emitted after the marked days are set in gtk_calendar_select_day().
2023-03-01 00:48:05 +02:00
Corey Berla
a59bf6e3cc calendar: Only apply the marked_day to the current month
The marked day gets applied to the current month, and either the previous
or subsequent month if they are visible within the current month.
This doesn't make any sense and likely was an accidental regression
in a6f9052cf1.  Clarify the docs.
2023-03-01 00:47:36 +02:00
Corey Berla
b06294d5d7 calendar: Add css style for marked days
As part of a6f9052cf1, marked days lost
their style, essentially making that function worthless.  Previously,
they were simply bolded, but that doesn't give them proper justice.
2023-03-01 00:47:06 +02:00
Arjan Molenaar
3f9b7dd863 macos: Command should not come from gettext
Instead, just provide the right character.

See also
https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkaccelgroup.c#L916.
2023-03-01 00:45:27 +02:00
Arjan Molenaar
3b36459630 macos: Use Command key symbol for meta
Show the Apple Command symbol ⌘ as keyboard shortcut for the Meta key on macos,
similar to GtkAccelGroup.
2023-03-01 00:45:09 +02:00
Corey Berla
5c4f3a1943 gtkdroptarget: Notify value property on local drag
The value property is only getting notified when it's unset
or when it's set from gdk_drop_real_value_async().  Make sure
to always notify :value when its changed
2023-03-01 00:39:41 +02:00
Lukáš Tyrychtr
b53bd5b670 Don't present GTK class names to assistive technologies even as a fallback
A screen reader user is not interested in GTK internals, for example,
he does not care whether a button is an image button or not,
and a screen reader will report the fact that it is a button anyway.
Same applies for GtkEntry widgets, for example.

This actually is sufficient to fix gnome-control-center#2244.
And, according to the discussion in #5145, it should be fine.
2023-03-01 00:36:07 +02:00
Matthias Clasen
6257243574 Merge branch 'revert-font-chooser-filter-4-8' into 'gtk-4-8'
Revert "Fix an assertion in GtkFontChooserWidget when setting a filter."

See merge request GNOME/gtk!5568
2023-02-28 13:00:35 +00:00
Akira TAGOH
e18e99209e Revert "Fix an assertion in GtkFontChooserWidget when setting a filter."
Actually this filter hasn't ported to 4.8 branch and
the merge request GNOME/gtk!5514 has been accidentally merged.

This reverts commit f4768f16c8.
2023-02-28 21:42:00 +09:00
Matthias Clasen
8e9e32abaf Merge branch 'fix-font-chooser-filter-4-8' into 'gtk-4-8'
Fix an assertion in GtkFontChooserWidget when setting a filter.

See merge request GNOME/gtk!5514
2023-02-15 03:54:38 +00:00
Akira TAGOH
f4768f16c8 Fix an assertion in GtkFontChooserWidget when setting a filter.
(cherry-picked from commit 4532c3020b)
2023-02-14 15:12:52 +09:00
Matthias Clasen
790b9d59ad Merge branch 'cherry-pick-824e9833' into 'gtk-4-8'
[4.8.x] gdk/x11: Reset all scroll valuators on enter

See merge request GNOME/gtk!5480
2023-02-07 02:34:50 +00:00
Carlos Garnacho
37843ec941 gdk/x11: Reset all scroll valuators on enter
We no longer need to make much distinction between multiple logical
devices, plus it breaks esp. with the Xwayland input device distribution.
Just iterate across all devices and reset their scroll valuators.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4160


(cherry picked from commit 824e983372)
2023-02-04 11:37:01 -05:00
Sabri Ünal
1ef03e6eb8 Update Turkish translation 2023-01-15 22:43:19 +00:00
Matteo Percivaldi
1ff3a26c96 gtkcssanimatedstyle: Fix return of new_advance()
This was causing animation and transition to stop randomly and reset
their state to initial state.

This issue has existed since commit
7b68bdb831.

Closes #4426
2023-01-13 15:15:10 -05:00
Matthias Clasen
92ebf8ab13 fontchooser: Drop a few errant translations
No point in translating these properties, they
are not strings.

Fixes: #5146
2023-01-12 18:38:44 -05:00
Matthias Clasen
7169d346ec build: Use a stable harfbuzz
We don't need the latest harfbuzz.
Stick to 4.0 for now.
2023-01-12 18:37:50 -05:00
Matthias Clasen
162b061ad2 Merge branch 'cherry-pick-e7f798dc' into 'gtk-4-8'
[4.8 cherry-pick] gdk/surface: Handle clicks outside client surfaces

See merge request GNOME/gtk!5373
2023-01-11 18:14:03 +00:00
Emin Tufan Çetin
83284e6a9d Update Turkish translation 2023-01-11 06:59:32 +00:00
Sabri Ünal
4a38d5d1d5 Update Turkish translation 2023-01-11 05:31:28 +00:00
Matthias Clasen
a87b3f63ec Merge branch 'cherry-pick-b4db4893' into 'gtk-4-8'
Fix building `tests/mountoperation.c` on Windows (backport MR!5126 to gtk-4-8)

See merge request GNOME/gtk!5408
2023-01-09 10:58:46 +00:00
Matthias Clasen
66091f8139 Merge branch 'fix-windows-build-testmountoperation' into 'main'
tests/testmountoperation.c: Fix build on Windows

See merge request GNOME/gtk!5126

(cherry picked from commit b4db48935d)

1a5a65ac tests/testmountoperation.c: Fix build on Windows
2023-01-09 05:08:56 -05:00
Matthias Clasen
46eebcb2ac Merge branch 'cherry-pick-188f9269' into 'gtk-4-8'
Cherrypick to 4.8: listitemwidget: Setup factory only once the widget is visible

See merge request GNOME/gtk!5378
2023-01-07 15:06:05 +00:00
Nart Tlisha
1e27563425 Update Abkhazian translation 2023-01-05 12:23:44 +00:00
Benjamin Otte
2aaefd9ff6 Merge branch 'wip/corey/list-item-visible' into 'main'
listitemwidget: Setup factory only once the widget is visible

See merge request GNOME/gtk!5374

(cherry picked from commit 188f9269b7)

7ad693f8 gtkcolumnviewcolumn: Only create cells when the column is visible
2022-12-30 19:45:00 -05:00
Carlos Garnacho
826030dcc2
gdk/surface: Handle clicks outside client surfaces
The owner_events=TRUE grab makes GDK on X11 see events happening
outside every client window as received on the grab window.
Additionally check that the pointer is inside the grab window
(i.e. it received GDK_CROSSING_NORMAL crossing events for the
core pointer) in order to handle clicks happening outside client
windows.

These new paths are expected to be a no-op on Wayland, and to
also work for touchscreen input on X11, due to emulated pointer
events.
2022-12-29 13:21:07 +11:00
Matthias Clasen
748b68d58b Fix typo in NEWS 2022-12-22 23:05:37 -05:00
Matthias Clasen
74ed1b9e35 Post-release version bump 2022-12-22 14:12:14 -05:00
Matthias Clasen
793831af8a 4.8.3 2022-12-22 14:07:27 -05:00
Matthias Clasen
d51734d83b Merge branch 'cherry-pick-acd7d739' into 'gtk-4-8'
[4.8] GdkWin32: Fix resizes with native decorations

See merge request GNOME/gtk!5368
2022-12-22 18:41:22 +00:00
Luca Bacci
40ed5ed494 GdkWin32: Fix resizes with native decorations
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5142
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5088
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5090
2022-12-22 18:03:41 +02:00
Matthias Clasen
9b75292a63 Merge branch 'hicolor-backport' into 'gtk-4-8'
Merge branch 'include-hicolor-index-theme-as-resource-rebased' into 'main'

See merge request GNOME/gtk!5364
2022-12-21 07:30:05 +00:00
Matthias Clasen
db5543e83b tests: Maybe skip introspection tests
If we don't find the python gi module,
skip the introspection test.
2022-12-20 22:40:36 -05:00
Luca Bacci
5844ecf381 Merge branch 'include-hicolor-index-theme-as-resource-rebased' into 'main'
Include hicolor index.theme as a resource (rebased)

Closes #5303

See merge request GNOME/gtk!5361
2022-12-20 21:52:17 -05:00
Benjamin Otte
afaeadcf67 Merge branch 'cherry-pick-ae097d96' into 'gtk-4-8'
listbase: Cancel rubberband if not handling drag

See merge request GNOME/gtk!5363
2022-12-21 02:41:07 +00:00
Benjamin Otte
14823c6bd6 Merge branch 'wip/antoniof/listbase-rubberband-better-fix' into 'main'
listbase: Cancel rubberband if not handling drag

See merge request GNOME/gtk!4831

(cherry picked from commit ae097d9674)

efbd2289 listbase: Cancel rubberband if not handling drag
2022-12-20 20:19:15 -05:00
Aleksandr Melman
a2d95db723 Update Russian translation 2022-12-20 09:21:34 +00:00
Matthias Clasen
ecbfccfc55 Merge branch 'cherry-pick-1f001a8f' into 'gtk-4-8'
Merge branch 'wip/corey/listbase-focus' into 'main'

See merge request GNOME/gtk!5338
2022-12-15 17:10:33 +00:00
Matthias Clasen
ef6f9cd7c6 Merge branch 'cherry-pick-e8f70be2' into 'gtk-4-8'
Merge branch 'wip/otte/for-5422' into 'main'

See merge request GNOME/gtk!5331
2022-12-15 16:27:57 +00:00
Benjamin Otte
9df10fa96f Merge branch 'wip/corey/listbase-focus' into 'main'
listbase: Use set_focus_child properly

Closes #5433 and #5432

See merge request GNOME/gtk!5169

(cherry picked from commit 1f001a8f6a)

7081bfc6 listbase: Split scroll_to_item for reuse
93e591fd listbase: Use set_focus_child properly
2022-12-14 22:21:54 -05:00
Matthias Clasen
779f8063d3 Merge branch 'x11-fixes-backports-4-8' into 'gtk-4-8'
Assorted x11 fix backports

See merge request GNOME/gtk!5333
2022-12-15 00:25:25 +00:00
Matthias Clasen
24508e07f0 Merge branch 'update-ci-image-4-8' into 'gtk-4-8'
text: Prevent unexpected notify::direction emissions

See merge request GNOME/gtk!5334
2022-12-15 00:24:54 +00:00
Matthias Clasen
dcc0da218a Getting desperate 2022-12-14 15:25:15 -05:00
Matthias Clasen
70cb06abcd ci: Another fixup 2022-12-14 14:29:47 -05:00
Matthias Clasen
1f40e88153 ci: Add /home/user/.local/bin to PATH 2022-12-14 13:51:42 -05:00
Matthias Clasen
93df6447fa Install meson 0.64 in ci jobs 2022-12-14 12:49:54 -05:00
Matthias Clasen
1e60aa122a ci: Try to defeat the caching
Drop subprojects/glib from the caching, since it
fails to update.
2022-12-14 12:49:54 -05:00
Emmanuele Bassi
cee282a282 vulkan: Add missing enumeration
Check for VK_ERROR_COMPRESSION_EXHAUSTED_EXT.
2022-12-14 12:48:32 -05:00
Matthias Clasen
19aa79d511 Don't emit ::notify from a getter
GdkX11Keymap ddetermines the direction of the
keymap on demand, and was emitting notify::direction
2022-12-14 11:28:19 -05:00
Matthias Clasen
55d8469fde mountoperation: Add a mnemonic to a button
This is a good practice, even if this is a rarely
used dialog.
2022-12-14 11:28:19 -05:00
Matthias Clasen
8d4a14e082 mountoperation: Don't use a treeview
Port the process list from GtkTreeView
to GtkListView, and fix a number of broken
things along the way.
2022-12-14 11:28:19 -05:00
Matthias Clasen
3ab28f8f8e testmountoperation: Test process dialog
Without this, it is hard to trigger the
dialog. Event with this, we have to force
GtkMountOperation to use its own dialog.
2022-12-14 11:28:19 -05:00
Matthias Clasen
55dd442955 mountoperation: Survive on Wayland
The code was assuming it is dealing with an
X11 display, and trigger assertions. Fix that
to make it work at least as well as it does
on Windows.
2022-12-14 11:28:19 -05:00
Matthias Clasen
9f4baac5a2 text: Prevent unexpected notify::direction emissions
Calling gdk_device_get_direction can trigger a
notify::direction emissions, since the X11 backend
determines the direction on demand. Prevent that by
forcing the direction to be determined ahead of time.

Fixes: #5311
2022-12-14 11:28:19 -05:00
Carlos Garnacho
0dbf91123d gdk/x11: Clear all data in GdkSurfaceX11 finalization
Currently, the GdkSurfaceX11 implementation relies that the upper
layers hid the surface before destruction, and that no
GdkSurfaceClass.compute_resize happened between them. If these
circumstances happened, there would be a compute_size timeout left
dangling after the surface got destroyed, poking at incorrect data
later on. Something that looks like this was reported in the
recent mutter-x11-frames "SSD frames server":

    mutter-x11-frames:423016): GLib-GObject-WARNING **: 19:41:16.869: invalid unclassed pointer in cast to 'GtkWindow'

    Thread 1 "mutter-x11-fram" received signal SIGTRAP, Trace/breakpoint trap.
    g_logv (log_domain=0x7ffff7f7c4f8 "GLib-GObject", log_level=G_LOG_LEVEL_WARNING, format=<optimized out>, args=<optimized out>) at ../../../glib/gmessages.c:1433
    1433	../../../glib/gmessages.c: No such file or directory.
    (gdb) bt
    #0  g_logv (log_domain=0x7ffff7f7c4f8 "GLib-GObject", log_level=G_LOG_LEVEL_WARNING, format=<optimized out>, args=<optimized out>) at ../../../glib/gmessages.c:1433
    #1  0x00007ffff73470ff in g_log (log_domain=log_domain@entry=0x7ffff7f7c4f8 "GLib-GObject", log_level=log_level@entry=G_LOG_LEVEL_WARNING, format=format@entry=0x7ffff7f84da8 "invalid unclassed pointer in cast to '%s'")
        at ../../../glib/gmessages.c:1471
    #2  0x00007ffff7f72892 in g_type_check_instance_cast (type_instance=type_instance@entry=0x5555558e04b0, iface_type=<optimized out>) at ../../../gobject/gtype.c:4144
    #3  0x00007ffff791e77d in toplevel_compute_size (toplevel=<optimized out>, size=0x7fffffffe170, widget=0x5555558e04b0) at ../../../gtk/gtkwindow.c:4227
    #4  0x00007ffff7f4f3b0 in g_closure_invoke (closure=0x555555898cc0, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7fffffffdeb0, invocation_hint=invocation_hint@entry=0x7fffffffde30)
        at ../../../gobject/gclosure.c:832
    #5  0x00007ffff7f62076 in signal_emit_unlocked_R
        (node=node@entry=0x55555588feb0, detail=detail@entry=0, instance=instance@entry=0x55555560e990, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffdeb0)
        at ../../../gobject/gsignal.c:3796
    #6  0x00007ffff7f68bf5 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffe050) at ../../../gobject/gsignal.c:3549
    #7  0x00007ffff7f68dbf in <emit signal ??? on instance 0x55555560e990 [GdkX11Toplevel]> (instance=<optimized out>, signal_id=<optimized out>, detail=detail@entry=0) at ../../../gobject/gsignal.c:3606
    #8  0x00007ffff7a8de96 in gdk_toplevel_notify_compute_size (toplevel=<optimized out>, size=size@entry=0x7fffffffe170) at ../../../gdk/gdktoplevel.c:112
    #9  0x00007ffff7a4b15a in compute_toplevel_size (surface=surface@entry=0x55555560e990 [GdkX11Toplevel], update_geometry=update_geometry@entry=1, width=width@entry=0x7fffffffe220, height=height@entry=0x7fffffffe224)
        at ../../../gdk/x11/gdksurface-x11.c:281
    #10 0x00007ffff7a4c3b2 in compute_size_idle (user_data=0x55555560e990) at ../../../gdk/x11/gdksurface-x11.c:356
    #11 0x00007ffff733f67f in g_main_dispatch (context=0x55555563f6e0) at ../../../glib/gmain.c:3444
    #12 g_main_context_dispatch (context=context@entry=0x55555563f6e0) at ../../../glib/gmain.c:4162
    #13 0x00007ffff733fa38 in g_main_context_iterate (context=0x55555563f6e0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4238
    #14 0x00007ffff733fcef in g_main_loop_run (loop=loop@entry=0x5555560874a0) at ../../../glib/gmain.c:4438
    #15 0x0000555555557de0 in main (argc=<optimized out>, argv=<optimized out>) at ../src/frames/main.c:68

It perhaps makes sense to warn in these situations, but either way
it sounds like gdk_surface_x11_finalize() could enforce the correct
behavior by ensuring there is no dangling timeouts/data. This commit
does that.
2022-12-14 07:41:03 -05:00
Matthias Clasen
4733352ce3 Don't emit ::notify from a getter
GdkX11Keymap ddetermines the direction of the
keymap on demand, and was emitting notify::direction
2022-12-14 07:36:11 -05:00
Danial Behzadi
aabae92482 Update Persian translation 2022-12-14 12:33:15 +00:00
Matthias Clasen
b2380a21ef mountoperation: Add a mnemonic to a button
This is a good practice, even if this is a rarely
used dialog.
2022-12-14 07:27:27 -05:00
Matthias Clasen
573204987c mountoperation: Don't use a treeview
Port the process list from GtkTreeView
to GtkListView, and fix a number of broken
things along the way.
2022-12-14 07:27:00 -05:00
Matthias Clasen
2f84859847 testmountoperation: Test process dialog
Without this, it is hard to trigger the
dialog. Event with this, we have to force
GtkMountOperation to use its own dialog.
2022-12-14 07:26:54 -05:00
Matthias Clasen
f4abf696f2 mountoperation: Survive on Wayland
The code was assuming it is dealing with an
X11 display, and trigger assertions. Fix that
to make it work at least as well as it does
on Windows.
2022-12-14 07:26:43 -05:00
Corey Berla
dc59b1c588 Merge branch 'wip/otte/for-5422' into 'main'
contentserializer: Serialize to file:// if possible

Closes #5422

See merge request GNOME/gtk!5330

(cherry picked from commit e8f70be2c1)

ea056d26 contentserializer: Serialize to file:// if possible
2022-12-14 07:25:48 -05:00
Matthias Clasen
88c6c55d3a text: Prevent unexpected notify::direction emissions
Calling gdk_device_get_direction can trigger a
notify::direction emissions, since the X11 backend
determines the direction on demand. Prevent that by
forcing the direction to be determined ahead of time.

Fixes: #5311
2022-12-14 07:25:30 -05:00
Matthias Clasen
c7185c65c9 Merge branch 'wip/corey/cherrypick-from-main' into 'gtk-4-8'
Cherrypick into 4.8

See merge request GNOME/gtk!5312
2022-12-09 21:26:30 +00:00
Olga Smirnova
d758ea2e5e Add Interlingue translation 2022-12-09 20:36:05 +00:00
Corey Berla
4a04cf610e atspicontext: Log more helpful warnings when the a11y bus doesn't exist 2022-12-09 08:09:28 -10:00
Corey Berla
9252b88c23 atspicontext: Cache empty atspi bus address
We are caching the bus address as data on the display object when it
exists, but fail to set the data when the bus address doesn't exist.
That causing excessive calls to GetAddress when the accesssbility
bus doesn't exist. Make sure to cache a non-existent accessibility
bus by setting the "" string.
2022-12-09 08:09:24 -10:00
Corey Berla
b2356dbe7b atspicontext: Log failure to connect to a11y
GTK depends on the a11y infrastructure to be in place unless GTK_A11Y is
set to none.  It appears that despite that, users attempt to
get around the a11y requirement without setting GTK_A11Y.
This can cause, amongst other issues, performance problems
with gtk applications.  Log failure to connect to the a11y
bus.
2022-12-09 08:09:05 -10:00
Asier Sarasua Garmendia
5186430d9d Update Basque translation 2022-12-03 09:45:52 +00:00
Benjamin Otte
272e354d57 Merge branch 'cherry-pick-a9c9678e' into 'gtk-4-8'
Merge branch 'workaround-glx-issue' into 'main'

See merge request GNOME/gtk!5287
2022-12-02 17:10:38 +00:00
Benjamin Otte
b17ccd13e6 Merge branch 'workaround-glx-issue' into 'main'
GLX: Add extra glXMakeContextCurrent () call to work around a DRI issue

Closes #4499, #5387, and #5170

See merge request GNOME/gtk!5285

(cherry picked from commit a9c9678e1f)

f788e994 GLX: Add extra glXMakeContextCurrent () call to work around a DRI issue
2022-12-02 11:09:11 -05:00
Nart Tlisha
b061d413e4 Update Abkhazian translation 2022-12-02 10:13:21 +00:00
Matthias Clasen
3ec2526776 Merge branch 'wip/smcv/ci-4-8' into 'gtk-4-8'
[4.8.x] subprojects: Pin GLib to version 2.74.x

See merge request GNOME/gtk!5252
2022-11-25 14:23:22 +00:00
Simon McVittie
e50fbb6c86 subprojects: Pin GLib to version 2.74.x
GLib 2.74.x and GTK 4.8.x both correspond to the GNOME 43 cycle. Keeping
GLib on the 2.74.x branch avoids a CI regression when GLib git main
depends on a newer Meson version than the one GTK's CI installs, which
has happened in 2.75.x as a result of GNOME/glib!3077.

Signed-off-by: Simon McVittie <smcv@debian.org>
2022-11-24 10:25:43 +00:00
Carlos Garnacho
753c6f2435 Merge branch 'wip/carlosg/osk-activation-4-8' into 'gtk-4-8'
gtktext: Claim gesture more selectively [4.8]

See merge request GNOME/gtk!5233
2022-11-18 18:25:59 +00:00
Carlos Garnacho
cc5ba83eba gdksurface: Do not consider GDK_TOUCH_END/CANCEL as popup-dismiss worthy
GDK_TOUCH_END deserves the same treatment than GDK_BUTTON_RELEASE, since it's
subject to the same circumstances (popping up a menu on long press would be
immediately dismissed on release if we handled them there). Ideally, we would
want to match releases that we obtained a press for while grabbed, but as
the popup is also dismissed on GDK_BUTTON_PRESS/GDK_TOUCH_BEGIN, there's no
use for this tracking.

And GDK_TOUCH_CANCEL sounds weird as a reason to dismiss popups, just like
crossing events would.

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/2512

(cherry-picked from commit 2ff4c77c5500110e2b387a8764ab19a92045ff4e)
2022-11-18 18:36:50 +01:00
Carlos Garnacho
3b940b12f6 gtktext: Claim gesture more selectively
Even though button 1 (or touch down) presses do most often have
an effect in one way or another (starting drag, moving focus,
starting selection, ...), there is one situation that they do
immediately nothing: When clicking on the entry does not move
the text caret around. Dragging might start a selection, but
the entry did not do anything just yet, and an immediate
button/touch release should remain at "did nothing".

And that is precisely the hint that the Wayland IM context's click
gesture takes, clicks that do not scroll nor move the caret around,
having the GtkText not claim the gesture in that situation makes
the IM gesture able to do its thing without in-fighting.

This is typically not a problem when the GtkText is embedded in
another GtkEditable implementation (e.g. GtkEntry), since the
IM gesture is inactive and capturing from the parent widget, so
gets a pass that it otherwise doesn't get when both gestures are
in the same widget. This makes it work regardless of GtkText not
being a child of a composite widget, like NautilusQueryEditor
and AdwRowEntry.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5351

(cherry-picked from commit 09b982f0264e42bda3e8471bb25abec5ee742ecc)
2022-11-18 18:36:32 +01:00
Matthias Clasen
205783d9b0 Merge branch 'cherry-pick-4.8' into 'gtk-4-8'
Cherry-pick changes from main for gtk-4-8

See merge request GNOME/gtk!5213
2022-11-17 03:49:51 +00:00
Carlos Garnacho
873c304a94 gdk/wayland: Use serial of the latest implicit grab available
When getting the serial for primary/clipboard selections we used a
function that largely relied on a GdkEvent being passed. We have
another available function that looks up the most recent serial
given the ongoing touch/tablet input as well.

This is the second best, compared to actually knowing the
input/device from the event that was received by the UI an triggered
the clipboard operation, and is already in use in other places
(e.g. window dragging). It is valid for these situations too.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5250
2022-11-12 04:14:47 +02:00
Colin Kinloch
e551a9d1c4 wayland: calculate union of geometry of all monitors for toplevel bounds
Signed-off-by: Colin Kinloch <colin.kinloch@collabora.com>
2022-11-12 03:38:13 +02:00
Adam Williamson
824ff01eee focus: fall back to old behaviour if we didn't focus anything
8455b9ac74 seems to have introduced a problem where we can wind
up focusing no widget at all if the `while (parent)` loop doesn't
find a widget it can successfully move the focus to. This 'fixes'
that by falling back to doing the previous thing if we make it
all the way through that loop without moving the focus. Thanks to
@coreyberla for a hint to improve the implementation.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2022-11-12 03:37:52 +02:00
Carlos Garnacho
9b74027dea gdk/wayland: Fix button mask calculation on button events
There's 2 things broken here:
- The mask was calculated on top of the GDK button (i.e. skipping
  4-7 buttons), so GDK_BUTTON4_MASK and GDK_BUTTON5_MASK were not
  assigned. This is now calculated on the (continuous) BTN_ evcodes
  so it is guaranteed that the next 2 physical buttons (i.e.
  back/forward) get these two places in the mask assigned.
- Furthermore, these buttons would be pushed to places in the
  modifier mask that they didn't belong to. It is now checked hard
  that only the first 5 buttons enable a modifier flag.

Overall, this ensures that no event masks with bonkers values are
forwarded, and that no stale implicit grabs are left after additional
buttons are pressed.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5301
2022-11-12 03:37:34 +02:00
Luca Bacci
5b98e171b2 Merge branch 'do-not-block-input-wm-mouse-activate-gtk-4-8' into 'gtk-4-8'
GdkWin32: do not block input in advance from WM_MOUSEACTIVATE

See merge request GNOME/gtk!5207
2022-11-10 08:50:29 +00:00
Luca Bacci
f7d4a52ec3 GdkWin32: Do not use MA_NOACTIVATEANDEAT
GTK knows when a surface is modally blocked and automatically drops
button press and release events, so do not block input in advance
from WM_MOUSEACTIVATE.
2022-11-10 09:29:24 +01:00
Balázs Úr
1e5b47c7ef Update Hungarian translation 2022-11-05 22:22:32 +00:00
Daniel Mustieles
953c2ec3ae Updated Spanish translation 2022-11-02 09:45:53 +01:00
Sabri Ünal
ff8aadba7b Update Turkish translation 2022-11-02 06:04:08 +00:00
Nathan Follens
381c056070 Update Dutch translation 2022-11-01 23:10:49 +00:00
Zurab Kargareteli
f70c3548e1 Update Georgian translation 2022-11-01 19:57:41 +00:00
Nart Tlisha
5863ddbfdd Update Abkhazian translation 2022-10-31 09:51:47 +00:00
Matthias Clasen
c1c1daba40 Merge branch 'revert-9c919ffa462dd4511da0bfd19d36d2e15c51651b' into 'gtk-4-8'
[4.8] Revert "treepopover: Do not propagate natural width of content"

See merge request GNOME/gtk!5071
2022-10-26 22:08:53 +00:00
Mat
339b9eb1b9 Revert "treepopover: Do not propagate natural width of content"
This reverts commit 9c919ffa46.
2022-10-26 13:51:23 +03:00
Matthias Clasen
f569318d6f Merge branch 'cherry-pick-c00a23eb' into 'gtk-4-8'
wayland: Fix keycode->keyval mapping

See merge request GNOME/gtk!5167
2022-10-25 03:14:23 +00:00
Matthias Clasen
c5beeddff0 Post-release version bump 2022-10-24 14:04:36 -04:00
Matthias Clasen
81b8426360 4.8.2 2022-10-24 13:46:56 -04:00
Matthias Clasen
bb61b5fb5b Merge branch 'fix-wayland-keycode-mapping' into 'main'
wayland: Fix keycode->keyval mapping

Closes #5277

See merge request GNOME/gtk!5147

(cherry picked from commit c00a23ebbc)

1894a896 wayland: Fix keycode->keyval mapping
2022-10-24 17:05:06 +00:00
Мирослав Николић
b760f57ae1 Update Serbian translation 2022-10-23 09:21:30 +00:00
Matthias Clasen
070926a4cc Merge branch 'wip/antoniof/backport-list-focus' into 'gtk-4-8'
Backport MR !5023 to 4.8

See merge request GNOME/gtk!5157
2022-10-21 17:34:35 +00:00
Matthias Clasen
7a183681b1 Merge branch 'fix-focus-4-8' into 'gtk-4-8'
[4.8] window: Fix focus updates

See merge request GNOME/gtk!5133
2022-10-21 17:33:13 +00:00
Matthias Clasen
14c7a001a6 editablelabel: Defer changes on focus-out
We can get spurious focus-out/-in pairs when
the editable label is in a popover that gets
a Wayland keyboard enter event as a result of
clicking the editable label.

A timeout isn't a great solution, but nothing
better is available right now.

Fixes: #4864
2022-10-21 14:38:08 +03:00
Matthias Clasen
bcad03da6c window: Keep a reference to move_focus_widget
If we don't take a reference, it can happen that
the pointer is no longer valid by the time we
dereference it in after_paint.
2022-10-21 14:37:43 +03:00
António Fernandes
5d9576abb9 columnview: Forward all focus to child
For the same reasoning as the preceding commit.

Also don't make GtkColumnView focusable. Its internal list view
is already focusable, which is enough to take care of the empty
view case.


(cherry picked from commit 9cb8d21cb5)
2022-10-21 08:03:43 +00:00
António Fernandes
b86c91de1d listbase: Grab focus on items instead of container
The container view itself being focusable makes keyboard navigation
slower by adding a useless focus step.

It also means if an item gets removed, the focus jumps back to the view,
instead of jumping to the next item, as seen in nautilus bug report:
https://gitlab.gnome.org/GNOME/nautilus/-/issues/2489

Instead of making the GtkListBase container itself focusable, override
the .grab_focus() vfunc. This way, calling gtk_widget_grab_focus() on
the view container keeps working sucessfully, but focuses the focus
item directly instead.

This is particularly useful to have because applicaiton authors do
not have direct acess to this class's children, so they can't call
gtk_widget_grab_focus() on them directly.


(cherry picked from commit 4fc4298920)
2022-10-21 08:03:14 +00:00
Matthias Clasen
a0d85f36ab window: Don't focus invisible widgets
Only clear a queued move_focus if the widget
we are focusing is actually visible.

This was happening in some cases when popovers
are dismissed by clicking outside, and it was
causing us to miss proper focus updates that
were already queued.
2022-10-18 20:37:19 +03:00
Matthias Clasen
8455b9ac74 window: Fix focus updates
This partially undoes changes from 3dbf5038fa.

That commit did two things:
1) Move the focus update to after-paint time
2) Change from grabbing focus to the visible parent
   to  calling move_focus (TAB)

The second part did have the unintended consequence
of moving focus laterally.

Fixes: #4903
2022-10-18 20:37:05 +03:00
Kukuh Syafaat
e87801f7e6 Update Indonesian translation 2022-10-18 02:47:51 +00:00
Luca Bacci
a4df9f3d09 Merge branch 'backport-mr-4986-to-gtk-4-8' into 'gtk-4-8'
Use native Windows API for converting keystrokes to characters

See merge request GNOME/gtk!5130
2022-10-17 20:40:44 +00:00
Philip Zander
f2ccb4192e Use native Windows API for converting keystrokes to characters 2022-10-17 22:11:35 +02:00
Aleksandr Melman
b71b7ea47f Update Russian translation 2022-10-09 13:24:27 +00:00
Zurab Kargareteli
ec9f9d9e96 Update Georgian translation 2022-10-06 21:21:24 +00:00
Jürgen Benvenuti
52dd917c6a Update German translation 2022-10-06 20:48:31 +00:00
Matthias Clasen
8070cfd173 Merge branch 'wip/headless-infinite-bounds-4-8' into 'gtk-4-8'
[4.8] Fix shrinking windows on suspend/resume

See merge request GNOME/gtk!5090
2022-10-06 10:42:51 +00:00
Jonas Ådahl
47b7988ccb 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:42:32 +02:00
Jonas Ådahl
79eab08797 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:42:27 +02:00
Alexander Shopov
2ca2a15637 Update Bulgarian translation 2022-10-04 18:07:20 +00:00
Jordi Mas
82ca302ec4 Update Catalan translation 2022-10-03 20:07:15 +02:00
Fabio Tomat
6387863256 Update Friulian translation 2022-10-03 08:35:52 +00:00
Goran Vidović
8c24e1467d Update Croatian translation 2022-10-02 14:03:13 +00:00
Emin Tufan Çetin
e7984a84cb Update Turkish translation 2022-10-01 14:56:16 +00:00
Matthias Clasen
a66b3caa1a Post-release version bump
This is an experiment to see if I can keep up with
doing post-release version bumps, so git snapshots
will always have a different version from released
tarballs.
2022-09-28 13:17:46 -04:00
94 changed files with 20053 additions and 8309 deletions

View File

@ -26,7 +26,7 @@ variables:
BACKEND_FLAGS: "-Dx11-backend=true -Dwayland-backend=true -Dbroadway-backend=true"
FEATURE_FLAGS: "-Dvulkan=enabled -Dcloudproviders=enabled"
MESON_TEST_TIMEOUT_MULTIPLIER: 3
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v38"
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v39"
FLATPAK_IMAGE: "quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master"
.only-default:
@ -80,9 +80,12 @@ fedora-x86_64:
needs: []
variables:
EXTRA_MESON_FLAGS: "--buildtype=debug --default-library=both"
before_script:
- PATH="/home/user/.local/bin:$PATH"
script:
- .gitlab-ci/show-info-linux.sh
- meson subprojects update
- pip3 install --user meson~=0.64
- meson subprojects update --reset
- mkdir _install
- meson --prefix=${CI_PROJECT_DIR}/_install
${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
@ -102,9 +105,14 @@ release-build:
needs: []
variables:
EXTRA_MESON_FLAGS: "--buildtype=release"
before_script:
- PATH="/home/user/.local/bin:$PATH"
script:
- .gitlab-ci/show-info-linux.sh
- meson subprojects update
- pip3 install --user meson~=0.64
- rm -rf subprojects/glib
- meson subprojects download glib
- meson subprojects update --reset
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
_build
- ninja -C _build
@ -126,9 +134,11 @@ fedora-mingw64:
mingw64-libepoxy
mingw64-pango
# mingw64-graphene (rawhide)
- PATH="/home/user/.local/bin:$PATH"
script:
- .gitlab-ci/show-info-linux.sh
- meson subprojects update
- pip3 install --user meson~=0.64
- meson subprojects update --reset
- mkdir _build && cd _build
- mingw64-meson -Dintrospection=disabled -Dgraphene:introspection=disabled
- ninja
@ -140,9 +150,12 @@ installed-tests:
variables:
EXTRA_MESON_FLAGS: "--prefix=/usr --libdir=/usr/lib64 -Dinstall-tests=true"
G_TEST_ACCESSIBLE: 1
before_script:
- PATH="/home/user/.local/bin:$PATH"
script:
- .gitlab-ci/show-info-linux.sh
- meson subprojects update
- pip3 install --user meson~=0.64
- meson subprojects update --reset
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
_build
- ninja -C _build
@ -197,7 +210,7 @@ macos:
needs: []
before_script:
- bash .gitlab-ci/show-info-osx.sh
- pip3 install --user meson==0.60.3
- pip3 install --user meson~=0.64
- pip3 install --user ninja
- export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH
- export MESON_FORCE_BACKTRACE=1
@ -334,6 +347,8 @@ static-scan:
needs: []
variables:
EXTRA_MESON_FLAGS: "--buildtype=debug"
before_script:
- PATH="/home/user/.local/bin:$PATH"
script:
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} _scan_build
- ninja -C _scan_build scan-build
@ -350,6 +365,8 @@ asan-build:
stage: analysis
needs: []
variables:
before_script:
- PATH="/home/user/.local/bin:$PATH"
script:
- CC=clang meson --buildtype=debugoptimized -Db_sanitize=address -Db_lundef=false -Dintrospection=disabled _build
- ninja -C _build
@ -365,7 +382,10 @@ reference:
needs: []
variables:
EXTRA_MESON_FLAGS: "--buildtype=release --force-fallback-for=gdk-pixbuf,pango"
before_script:
- PATH="/home/user/.local/bin:$PATH"
script:
- pip3 install --user meson~=0.64
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} -Dgtk_doc=true -Dgdk-pixbuf:gtk_doc=true -Dpango:gtk_doc=true _build
- meson compile -C _build
- mkdir -p _reference/

106
NEWS
View File

@ -1,3 +1,109 @@
Overview of Changes in 4.8.4, xx-xx-xxxx
========================================
Overview of Changes in 4.8.3, 22-12-2022
========================================
* GtkText:
- Claim gestures more selectively
- Prevent unexpected notify::direction emissions
* Accessibility:
- Remember if we don't find the a11y bus
* DND:
- Prefer file:// urls over other protocols
* GtkMountOperation:
- Work on Wayland
* GtkListView:
- Cancel rubberband if not handling drag
* Wayland:
- Fix button masks
* Windows:
- Fix resizes with native decorations
* X11:
- Fix some ordering problems with surface destruction
* Translation updates
Abkhazian
Basque
Dutch
Hungarian
Interlingue
Georgian
Persian
Russian
Spanish
Turkish
Overview of Changes in 4.8.2, 24-10-2022
========================================
* Input:
- Give input methods more control over resets and allow
them to preserve state
- Align interpretation of modifiers in key events
in X11 and Wayland
* GtkColumnView:
- Fixes to focus handling
* GtkPopover:
- Fix problems with focus when dismissing popovers
- Fix problems with focusing editable labels in popovers
* Build:
- Fix build problems with resources and non-gnu linkers
- Fix gi-docgen detection in cross builds
- Require meson 0.60
* Debugging:
- Make more debug options available in no-debug builds
- Improve consistency of debug logging
- Give names to all sources
* Accessibility:
- Introduce GtkAccessibleRange
* Wayland:
- Make monitor bounds handling more robust
- Prevent shrinking clients due to wrong toplevel bounds
* Broadway:
- Return correct pointer coordinates from device queries
* Windows:
- Use native API to translate key events
* Translation updates:
Brazilian Portuguese
British English
Bulgarian
Catalan
Croatian
Czech
Friulian
Galician
Georgian
German
Indonesian
Lithuanian
Polish
Portuguese
Russian
Serbian
Slovenian
Swedish
Turkish
Ukrainian
Overview of Changes in 4.8.1, 16-09-2022
========================================

View File

@ -362,7 +362,7 @@ do_drawingarea (GtkWidget *do_widget)
G_CALLBACK (scribble_resize), NULL);
drag = gtk_gesture_drag_new ();
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (drag), GDK_BUTTON_PRIMARY);
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (drag), 0);
gtk_widget_add_controller (da, GTK_EVENT_CONTROLLER (drag));
g_signal_connect (drag, "drag-begin", G_CALLBACK (drag_begin), da);

View File

@ -262,7 +262,8 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
message->key.state,
FALSE,
&translated,
&translated);
&translated,
NULL);
node = _gdk_event_queue_append (display, event);
_gdk_windowing_got_event (display, node, event, message->base.serial);

View File

@ -795,6 +795,22 @@ file_serializer_finish (GObject *source,
gdk_content_serializer_return_success (serializer);
}
static char *
file_get_native_uri (GFile *file)
{
char *path;
path = g_file_get_path (file);
if (path != NULL)
{
char *uri = g_filename_to_uri (path, NULL, NULL);
g_free (path);
return uri;
}
return g_file_get_uri (file);
}
static void
file_uri_serializer (GdkContentSerializer *serializer)
{
@ -811,7 +827,7 @@ file_uri_serializer (GdkContentSerializer *serializer)
file = g_value_get_object (gdk_content_serializer_get_value (serializer));
if (file)
{
uri = g_file_get_uri (file);
uri = file_get_native_uri (file);
g_string_append (str, uri);
g_free (uri);
}
@ -827,7 +843,7 @@ file_uri_serializer (GdkContentSerializer *serializer)
for (l = g_value_get_boxed (value); l; l = l->next)
{
uri = g_file_get_uri (l->data);
uri = file_get_native_uri (l->data);
g_string_append (str, uri);
g_free (uri);
g_string_append (str, "\r\n");

View File

@ -1517,6 +1517,16 @@ gdk_button_event_get_button (GdkEvent *event)
* An event related to a key-based device.
*/
static void
gdk_key_event_finalize (GdkEvent *event)
{
GdkKeyEvent *self = (GdkKeyEvent *) event;
g_free (self->compose_sequence);
GDK_EVENT_SUPER (event)->finalize (event);
}
static GdkModifierType
gdk_key_event_get_state (GdkEvent *event)
{
@ -1528,7 +1538,7 @@ gdk_key_event_get_state (GdkEvent *event)
static const GdkEventTypeInfo gdk_key_event_info = {
sizeof (GdkKeyEvent),
NULL,
NULL,
gdk_key_event_finalize,
gdk_key_event_get_state,
NULL,
NULL,
@ -1552,6 +1562,10 @@ GDK_DEFINE_EVENT_TYPE (GdkKeyEvent, gdk_key_event,
* @is_modifier: whether the event is a modifiers only event
* @translated: the translated key data for the given @state
* @no_lock: the translated key data without the given @state
* @compose_sequence: (transfer none) (nullable):
* The compose sequence string, either partial or only the
* final composed string, if that can be determined at event
* creation time. Used by selected IM modules.
*
* Creates a new `GdkKeyEvent`.
*
@ -1566,7 +1580,8 @@ gdk_key_event_new (GdkEventType type,
GdkModifierType state,
gboolean is_modifier,
GdkTranslatedKey *translated,
GdkTranslatedKey *no_lock)
GdkTranslatedKey *no_lock,
char *compose_sequence)
{
g_return_val_if_fail (type == GDK_KEY_PRESS ||
type == GDK_KEY_RELEASE, NULL);
@ -1579,6 +1594,7 @@ gdk_key_event_new (GdkEventType type,
self->key_is_modifier = is_modifier;
self->translated[0] = *translated;
self->translated[1] = *no_lock;
self->compose_sequence = g_strdup (compose_sequence);
return event;
}
@ -1609,6 +1625,26 @@ gdk_key_event_get_translated_key (GdkEvent *event,
return &(self->translated[0]);
}
/*< private >
* gdk_key_event_get_compose_sequence:
* @event: (type GdkKeyEvent): a key event
*
* Extracts the compose sequence string from a key event.
*
* Returns: (transfer none): the compose sequence string
*/
char *
gdk_key_event_get_compose_sequence (GdkEvent *event)
{
GdkKeyEvent *self = (GdkKeyEvent *) event;
g_return_val_if_fail (GDK_IS_EVENT (event), 0);
g_return_val_if_fail (GDK_IS_EVENT_TYPE (event, GDK_KEY_PRESS) ||
GDK_IS_EVENT_TYPE (event, GDK_KEY_RELEASE), FALSE);
return self->compose_sequence;
}
/**
* gdk_key_event_get_keyval:
* @event: (type GdkKeyEvent): a key event

View File

@ -259,6 +259,9 @@ typedef struct {
* @keycode: the raw code of the key that was pressed or released.
* @translated: the result of translating @keycode. First with the full
* @state, then while ignoring Caps Lock.
* @compose_sequence: optional string for use by selected IM modules.
* Contains either partial compose sequences or the final composed
* string of the keystroke sequence.
*
* Describes a key press or key release event.
*/
@ -270,6 +273,7 @@ struct _GdkKeyEvent
guint32 keycode;
gboolean key_is_modifier;
GdkTranslatedKey translated[2];
char *compose_sequence;
};
/*
@ -470,7 +474,8 @@ GdkEvent * gdk_key_event_new (GdkEventType type,
GdkModifierType modifiers,
gboolean is_modifier,
GdkTranslatedKey *translated,
GdkTranslatedKey *no_lock);
GdkTranslatedKey *no_lock,
char *compose_sequence);
GdkEvent * gdk_focus_event_new (GdkSurface *surface,
GdkDevice *device,
@ -597,6 +602,8 @@ GdkEvent * gdk_grab_broken_event_new (GdkSurface *surface,
GdkTranslatedKey * gdk_key_event_get_translated_key (GdkEvent *event,
gboolean no_lock);
char * gdk_key_event_get_compose_sequence (GdkEvent *event);
typedef enum
{
/* Following flag is set for events on the event queue during
@ -626,7 +633,6 @@ void _gdk_event_queue_flush (GdkDisplay *display);
double * gdk_event_dup_axes (GdkEvent *event);
G_END_DECLS
#endif /* __GDK_EVENTS_PRIVATE_H__ */

View File

@ -2789,9 +2789,10 @@ check_autohide (GdkEvent *event)
{
GdkDisplay *display;
GdkDevice *device;
GdkSurface *grab_surface;
GdkSurface *grab_surface, *event_surface;
GdkEventType evtype = gdk_event_get_event_type (event);
switch ((guint) gdk_event_get_event_type (event))
switch ((guint) evtype)
{
case GDK_BUTTON_PRESS:
#if 0
@ -2800,23 +2801,25 @@ check_autohide (GdkEvent *event)
// grabs, it will be delivered to the same place as the
// press, and will cause the auto dismissal to be triggered.
case GDK_BUTTON_RELEASE:
#endif
case GDK_TOUCH_BEGIN:
case GDK_TOUCH_END:
case GDK_TOUCH_CANCEL:
#endif
case GDK_TOUCH_BEGIN:
case GDK_TOUCHPAD_SWIPE:
case GDK_TOUCHPAD_PINCH:
display = gdk_event_get_display (event);
device = gdk_event_get_device (event);
if (gdk_device_grab_info (display, device, &grab_surface, NULL))
{
GdkSurface *event_surface;
event_surface = gdk_event_get_surface (event);
if (event_surface->autohide &&
!event_surface->has_pointer)
event_surface = NULL;
if (grab_surface != event_surface &&
grab_surface != event_surface->parent &&
grab_surface->autohide)
if (grab_surface->autohide &&
(!event_surface ||
(grab_surface != event_surface &&
grab_surface != event_surface->parent)))
{
GdkSurface *surface = grab_surface;
@ -2831,6 +2834,13 @@ check_autohide (GdkEvent *event)
}
}
break;
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
event_surface = gdk_event_get_surface (event);
if (event_surface->autohide &&
gdk_crossing_event_get_mode (event) == GDK_CROSSING_NORMAL)
event_surface->has_pointer = evtype == GDK_ENTER_NOTIFY;
break;
default:;
}

View File

@ -77,6 +77,7 @@ struct _GdkSurface
guint autohide : 1;
guint shortcuts_inhibited : 1;
guint request_motion : 1;
guint has_pointer : 1;
guint request_motion_id;

View File

@ -32,6 +32,9 @@ G_DEFINE_POINTER_TYPE (GdkToplevelSize, gdk_toplevel_size)
#define UNCONFIGURED_WIDTH 400
#define UNCONFIGURED_HEIGHT 300
#define DEFAULT_BOUNDS_WIDTH INT_MAX
#define DEFAULT_BOUNDS_HEIGHT INT_MAX
void
gdk_toplevel_size_init (GdkToplevelSize *size,
int bounds_width,
@ -68,8 +71,15 @@ gdk_toplevel_size_get_bounds (GdkToplevelSize *size,
g_return_if_fail (bounds_width);
g_return_if_fail (bounds_height);
*bounds_width = size->bounds_width;
*bounds_height = size->bounds_height;
if (size->bounds_width > 0)
*bounds_width = size->bounds_width;
else
*bounds_width = DEFAULT_BOUNDS_WIDTH;
if (size->bounds_height > 0)
*bounds_height = size->bounds_height;
else
*bounds_height = DEFAULT_BOUNDS_HEIGHT;
}
/**

View File

@ -94,7 +94,7 @@ gdk_vulkan_strerror (VkResult result)
* Because the Vulkan people don't make adding this too easy, here's
* the process to manage it:
* 1. go to
* https://github.com/KhronosGroup/Vulkan-Headers/blob/master/include/vulkan/vulkan_core.h
* https://github.com/KhronosGroup/Vulkan-Headers/blob/main/include/vulkan/vulkan_core.h
* 2. Find the line where this enum value was added.
* 3. Click the commit that added this line.
* 4. The commit you're looking at now should also change
@ -215,6 +215,10 @@ gdk_vulkan_strerror (VkResult result)
case VK_ERROR_PIPELINE_COMPILE_REQUIRED_EXT:
return "A requested pipeline creation would have required compilation, but the application requested compilation to not be performed. (VK_ERROR_PIPELINE_COMPILE_REQUIRED_EXT)";
#endif
#if VK_HEADER_VERSION >= 213
case VK_ERROR_COMPRESSION_EXHAUSTED_EXT:
return "An image creation failed because internal resources required for compression are exhausted. (VK_ERROR_COMPRESSION_EXHAUSTED_EXT)";
#endif
#if VK_HEADER_VERSION < 140
case VK_RESULT_RANGE_SIZE:
#endif
@ -488,7 +492,7 @@ gdk_vulkan_context_end_frame (GdkDrawContext *draw_context,
priv->draw_semaphore
},
.swapchainCount = 1,
.pSwapchains = (VkSwapchainKHR[]) {
.pSwapchains = (VkSwapchainKHR[]) {
priv->swapchain
},
.pImageIndices = (uint32_t[]) {
@ -608,7 +612,7 @@ gdk_vulkan_context_real_init (GInitable *initable,
{
g_set_error_literal (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_NOT_AVAILABLE,
"No supported image format found.");
goto out_surface;
goto out_surface;
}
priv->image_format = formats[i];
priv->has_present_region = device_supports_incremental_present (display->vk_physical_device);
@ -1037,8 +1041,8 @@ gdk_display_create_vulkan_instance (GdkDisplay *display,
GDK_VK_CHECK (vkEnumerateInstanceExtensionProperties, NULL, &n_extensions, extensions);
used_extensions = g_ptr_array_new ();
g_ptr_array_add (used_extensions, (gpointer) VK_KHR_SURFACE_EXTENSION_NAME);
g_ptr_array_add (used_extensions, (gpointer) GDK_DISPLAY_GET_CLASS (display)->vk_extension_name);
g_ptr_array_add (used_extensions, (gpointer) VK_KHR_SURFACE_EXTENSION_NAME);
g_ptr_array_add (used_extensions, (gpointer) GDK_DISPLAY_GET_CLASS (display)->vk_extension_name);
for (i = 0; i < n_extensions; i++)
{
@ -1118,7 +1122,7 @@ gdk_display_create_vulkan_instance (GdkDisplay *display,
if (have_debug_report)
{
PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallbackEXT;
vkCreateDebugReportCallbackEXT = (PFN_vkCreateDebugReportCallbackEXT) vkGetInstanceProcAddr (display->vk_instance, "vkCreateDebugReportCallbackEXT" );
GDK_VK_CHECK (vkCreateDebugReportCallbackEXT, display->vk_instance,
&(VkDebugReportCallbackCreateInfoEXT) {
@ -1167,7 +1171,7 @@ gdk_display_ref_vulkan (GdkDisplay *display,
}
display->vulkan_refcount++;
return TRUE;
}
@ -1180,7 +1184,7 @@ gdk_display_unref_vulkan (GdkDisplay *display)
display->vulkan_refcount--;
if (display->vulkan_refcount > 0)
return;
vkDestroyDevice (display->vk_device, NULL);
display->vk_device = VK_NULL_HANDLE;
if (display->vk_debug_callback != VK_NULL_HANDLE)

View File

@ -431,7 +431,8 @@ fill_key_event (GdkMacosDisplay *display,
state,
is_modifier,
&translated,
&no_lock);
&no_lock,
NULL);
}
static GdkEvent *

View File

@ -944,7 +944,8 @@ _gdk_macos_surface_synthesize_null_key (GdkMacosSurface *self)
0,
FALSE,
&translated,
&no_lock);
&no_lock,
NULL);
_gdk_event_queue_append (display, event);
}

View File

@ -83,6 +83,10 @@
#define BTN_STYLUS3 0x149 /* Linux 4.15 */
#endif
#define ALL_BUTTONS_MASK (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | \
GDK_BUTTON3_MASK | GDK_BUTTON4_MASK | \
GDK_BUTTON5_MASK)
#define GDK_SEAT_DEBUG(seat,type,...) GDK_DISPLAY_DEBUG(gdk_seat_get_display (GDK_SEAT (seat)),type,__VA_ARGS__)
typedef struct _GdkWaylandDevicePad GdkWaylandDevicePad;
@ -1716,7 +1720,19 @@ pointer_handle_button (void *data,
gdk_wayland_seat_set_frame_event (seat, event);
modifier = 1 << (8 + gdk_button - 1);
switch (button)
{
case BTN_RIGHT:
modifier = GDK_BUTTON3_MASK;
break;
case BTN_MIDDLE:
modifier = GDK_BUTTON2_MASK;
break;
default:
modifier = (GDK_BUTTON1_MASK << (button - BUTTON_BASE - 1)) & ALL_BUTTONS_MASK;
break;
}
if (state)
seat->pointer_info.button_modifiers |= modifier;
else
@ -2205,7 +2221,8 @@ deliver_key_event (GdkWaylandSeat *seat,
device_get_modifiers (seat->logical_pointer),
_gdk_wayland_keymap_key_is_modifier (keymap, key),
&translated,
&no_lock);
&no_lock,
NULL);
_gdk_wayland_display_deliver_event (seat->display, event);
@ -5322,7 +5339,7 @@ gdk_wayland_device_set_selection (GdkDevice *gdk_device,
g_return_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device));
seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (gdk_device));
serial = _gdk_wayland_seat_get_implicit_grab_serial (GDK_SEAT (seat), NULL);
serial = _gdk_wayland_seat_get_last_implicit_grab_serial (seat, NULL);
wl_data_device_set_selection (seat->data_device, source, serial);
}

View File

@ -203,7 +203,7 @@ gdk_wayland_keymap_get_entries_for_keycode (GdkKeymap *keymap,
{
const xkb_keysym_t *syms;
int num_syms;
num_syms = xkb_keymap_key_get_syms_by_level (xkb_keymap, hardware_keycode, layout, 0, &syms);
num_syms = xkb_keymap_key_get_syms_by_level (xkb_keymap, hardware_keycode, layout, level, &syms);
if (keys)
{
(*keys)[i].keycode = hardware_keycode;

View File

@ -292,7 +292,8 @@ gdk_wayland_primary_claim (GdkClipboard *clipboard,
}
seat = gdk_display_get_default_seat (GDK_DISPLAY (wdisplay));
serial = _gdk_wayland_seat_get_implicit_grab_serial (seat, NULL);
serial = _gdk_wayland_seat_get_last_implicit_grab_serial (GDK_WAYLAND_SEAT (seat),
NULL);
zwp_primary_selection_device_v1_set_selection (cb->primary_data_device,
cb->source,
serial);

View File

@ -1416,13 +1416,22 @@ configure_toplevel_geometry (GdkSurface *surface)
else
{
GdkMonitor *monitor;
GdkRectangle monitor_geometry;
GListModel *monitors;
GdkRectangle monitor_geometry, display_geometry = { 0 };
guint i;
monitor = g_list_model_get_item (gdk_display_get_monitors (display), 0);
gdk_monitor_get_geometry (monitor, &monitor_geometry);
bounds_width = monitor_geometry.width;
bounds_height = monitor_geometry.height;
g_object_unref (monitor);
monitors = gdk_display_get_monitors (display);
for (i = 0; i < g_list_model_get_n_items (monitors); i++)
{
monitor = g_list_model_get_item (monitors, i);
gdk_monitor_get_geometry (monitor, &monitor_geometry);
gdk_rectangle_union (&display_geometry, &monitor_geometry, &display_geometry);
g_object_unref (monitor);
}
bounds_width = display_geometry.width;
bounds_height = display_geometry.height;
}
gdk_toplevel_size_init (&size, bounds_width, bounds_height);

View File

@ -1857,7 +1857,8 @@ gdk_event_translate (MSG *msg,
0,
FALSE,
&translated,
&translated);
&translated,
NULL);
_gdk_win32_append_event (event);
}
break;
@ -1906,8 +1907,12 @@ gdk_event_translate (MSG *msg,
GdkTranslatedKey translated;
GdkTranslatedKey no_lock;
BYTE key_state[256];
wchar_t wbuf[100];
int ccount = 0;
GArray *translation;
MSG msg2;
int level = 0;
int effective_group = 0;
GdkModifierType consumed = 0;
char *composed = NULL;
/* Ignore key messages intended for the IME */
if (msg->wParam == VK_PROCESSKEY || in_ime_composition)
@ -1929,34 +1934,41 @@ gdk_event_translate (MSG *msg,
API_CALL (GetKeyboardState, (key_state));
ccount = 0;
if (msg->wParam == VK_PACKET)
{
ccount = ToUnicode (VK_PACKET, HIWORD (msg->lParam), key_state, wbuf, 1, 0);
if (ccount == 1)
{
if (wbuf[0] >= 0xD800 && wbuf[0] < 0xDC00)
{
if (msg->message == WM_KEYDOWN)
impl->leading_surrogate_keydown = wbuf[0];
else
impl->leading_surrogate_keyup = wbuf[0];
/* don't emit an event */
return_val = TRUE;
break;
}
else
{
/* wait until an event is created */;
}
}
}
keyval = GDK_KEY_VoidSymbol;
keycode = msg->wParam;
/* Get the WinAPI translation of the WM_KEY messages to characters.
The WM_CHAR messages are generated by a previous call to TranslateMessage() and always
follow directly after the corresponding WM_KEY* messages.
There could be 0 or more WM_CHAR messages following (for example dead keys don't generate
WM_CHAR messages - they generate WM_DEAD_CHAR instead, but we are not interested in those
messages). */
translation = g_array_sized_new (FALSE, FALSE, sizeof (gunichar2), 2);
while (PeekMessageW (&msg2, msg->hwnd, 0, 0, 0) && (msg2.message == WM_CHAR || msg2.message == WM_SYSCHAR))
{
/* The character is encoded in WPARAM as UTF-16. */
gunichar2 c = msg2.wParam;
/* Append character to translation string. */
g_array_append_val (translation, c);
/* Remove message from queue */
GetMessageW (&msg2, msg->hwnd, 0, 0);
}
if (translation->len > 0)
composed = g_utf16_to_utf8 ((gunichar2*)translation->data,
translation->len, NULL, NULL, NULL);
g_array_unref (translation);
translation = NULL;
/* Ignore control sequences like Backspace */
if (composed && g_unichar_iscntrl (g_utf8_get_char (composed)))
g_clear_pointer (&composed, g_free);
if (HIWORD (msg->lParam) & KF_EXTENDED)
{
switch (msg->wParam)
@ -1985,61 +1997,20 @@ gdk_event_translate (MSG *msg,
state = build_key_event_state (key_state);
group = get_active_group ();
if (msg->wParam == VK_PACKET && ccount == 1)
{
if (wbuf[0] >= 0xD800 && wbuf[0] < 0xDC00)
{
g_assert_not_reached ();
}
else if (wbuf[0] >= 0xDC00 && wbuf[0] < 0xE000)
{
wchar_t leading;
gdk_keymap_translate_keyboard_state ((GdkKeymap*) win32_keymap, keycode, state, group,
&keyval, &effective_group, &level, &consumed);
translated.keyval = keyval;
translated.consumed = consumed;
translated.layout = effective_group;
translated.level = level;
if (msg->message == WM_KEYDOWN)
leading = impl->leading_surrogate_keydown;
else
leading = impl->leading_surrogate_keyup;
keyval = gdk_unicode_to_keyval ((leading - 0xD800) * 0x400 + wbuf[0] - 0xDC00 + 0x10000);
}
else
{
keyval = gdk_unicode_to_keyval (wbuf[0]);
}
translated.keyval = keyval;
translated.consumed = 0;
translated.layout = 0;
translated.level = 0;
no_lock = translated;
}
else
{
int level = 0;
int effective_group = 0;
GdkModifierType consumed = 0;
gdk_keymap_translate_keyboard_state ((GdkKeymap*) win32_keymap, keycode, state, group,
&keyval, &effective_group, &level, &consumed);
translated.keyval = keyval;
translated.consumed = consumed;
translated.layout = effective_group;
translated.level = level;
gdk_keymap_translate_keyboard_state ((GdkKeymap*) win32_keymap, keycode,
state & ~GDK_LOCK_MASK, group, &keyval,
&effective_group, &level, &consumed);
no_lock.keyval = keyval;
no_lock.consumed = consumed;
no_lock.layout = effective_group;
no_lock.level = level;
}
if (msg->message == WM_KEYDOWN)
impl->leading_surrogate_keydown = 0;
else
impl->leading_surrogate_keyup = 0;
gdk_keymap_translate_keyboard_state ((GdkKeymap*) win32_keymap, keycode,
state & ~GDK_LOCK_MASK, group, &keyval,
&effective_group, &level, &consumed);
no_lock.keyval = keyval;
no_lock.consumed = consumed;
no_lock.layout = effective_group;
no_lock.level = level;
/* Only one release key event is fired when both shift keys are pressed together
and then released. In order to send the missing event, press events for shift
@ -2087,10 +2058,12 @@ gdk_event_translate (MSG *msg,
state,
is_modifier,
&translated,
&no_lock);
&no_lock,
composed);
_gdk_win32_append_event (event);
g_free (composed);
return_val = TRUE;
}
break;
@ -2169,7 +2142,8 @@ gdk_event_translate (MSG *msg,
build_key_event_state (key_state),
FALSE,
&translated,
&translated);
&translated,
NULL);
_gdk_win32_append_event (event);
@ -2182,7 +2156,8 @@ gdk_event_translate (MSG *msg,
build_key_event_state (key_state),
FALSE,
&translated,
&translated);
&translated,
NULL);
_gdk_win32_append_event (event);
}
@ -2754,22 +2729,15 @@ gdk_event_translate (MSG *msg,
}
break;
case WM_MOUSEACTIVATE:
{
if (GDK_IS_DRAG_SURFACE (window))
{
*ret_valp = MA_NOACTIVATE;
return_val = TRUE;
}
case WM_MOUSEACTIVATE:
if (GDK_IS_DRAG_SURFACE (window) ||
_gdk_modal_blocked (window))
{
*ret_valp = MA_NOACTIVATE;
return_val = TRUE;
}
if (_gdk_modal_blocked (window))
{
*ret_valp = MA_NOACTIVATEANDEAT;
return_val = TRUE;
}
}
break;
break;
case WM_POINTERACTIVATE:
if (GDK_IS_DRAG_SURFACE (window) ||
@ -3013,6 +2981,8 @@ gdk_event_translate (MSG *msg,
}
#endif
impl = GDK_WIN32_SURFACE (window);
/* Break grabs on unmap or minimize */
if (windowpos->flags & SWP_HIDEWINDOW ||
((windowpos->flags & SWP_STATECHANGED) && IsIconic (msg->hwnd)))
@ -3073,9 +3043,18 @@ gdk_event_translate (MSG *msg,
!(windowpos->flags & SWP_NOCLIENTSIZE) ||
(windowpos->flags & SWP_SHOWWINDOW))
{
if (!IsIconic (msg->hwnd) &&
!GDK_SURFACE_DESTROYED (window))
gdk_surface_request_layout (window);
if (!IsIconic (msg->hwnd) && !GDK_SURFACE_DESTROYED (window))
{
if (!_gdk_win32_surface_lacks_wm_decorations (window) &&
!(windowpos->flags & SWP_NOCLIENTSIZE) &&
window->width == impl->next_layout.configured_width &&
window->height == impl->next_layout.configured_height)
{
impl->inhibit_configure = TRUE;
}
gdk_surface_request_layout (window);
}
}
if ((windowpos->flags & SWP_HIDEWINDOW) &&

View File

@ -235,14 +235,6 @@ struct _GdkWin32Surface
/* The cursor that GDK set for this window via GdkDevice */
GdkWin32HCursor *cursor;
/* When VK_PACKET sends us a leading surrogate, it's stashed here.
* Later, when another VK_PACKET sends a tailing surrogate, we make up
* a full unicode character from them, or discard the leading surrogate,
* if the next key is not a tailing surrogate.
*/
wchar_t leading_surrogate_keydown;
wchar_t leading_surrogate_keyup;
/* Window size hints */
int hint_flags;
GdkGeometry hints;

View File

@ -1595,7 +1595,8 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
state,
gdk_x11_keymap_key_is_modifier (keymap, xev->detail),
&translated,
&no_lock);
&no_lock,
NULL);
if (ev->evtype == XI_KeyPress)
set_user_time (event);
@ -2063,19 +2064,10 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
xev->detail != XINotifyInferior && xev->mode != XINotifyPassiveUngrab &&
GDK_IS_TOPLEVEL (surface))
{
if (gdk_x11_device_xi2_get_device_type ((GdkX11DeviceXI2 *) device) != GDK_X11_DEVICE_TYPE_LOGICAL)
_gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (source_device));
else
{
GList *physical_devices, *l;
GList *l;
physical_devices = gdk_device_list_physical_devices (source_device);
for (l = physical_devices; l; l = l->next)
_gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (l->data));
g_list_free (physical_devices);
}
for (l = device_manager->devices; l; l = l->next)
_gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (l->data));
}
event = gdk_crossing_event_new (ev->evtype == XI_Enter

View File

@ -1912,7 +1912,7 @@ drag_grab (GdkDrag *drag)
root = GDK_DISPLAY_XROOTWIN (display);
seat = gdk_device_get_seat (gdk_drag_get_device (drag));
capabilities = GDK_SEAT_CAPABILITY_ALL_POINTING;
capabilities = GDK_SEAT_CAPABILITY_ALL_POINTING | GDK_SEAT_CAPABILITY_KEYBOARD;
cursor = gdk_drag_get_cursor (drag, x11_drag->current_action);
g_set_object (&x11_drag->cursor, cursor);

View File

@ -232,6 +232,12 @@ gdk_x11_gl_context_glx_make_current (GdkGLContext *context,
"Making GLX context %p current to drawable %lu",
context, (unsigned long) drawable);
/* Work around a glitch, see
* https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5281
*/
if (glXGetCurrentContext () != self->glx_context)
glXMakeContextCurrent (dpy, None, None, NULL);
if (!glXMakeContextCurrent (dpy, drawable, drawable, self->glx_context))
return FALSE;

View File

@ -603,7 +603,7 @@ update_direction (GdkX11Keymap *keymap_x11,
keymap_x11->have_direction = TRUE;
}
if (!had_direction || old_direction != keymap_x11->current_direction)
if (had_direction && old_direction != keymap_x11->current_direction)
{
g_object_notify (G_OBJECT (keyboard), "direction");
return TRUE;

View File

@ -759,6 +759,8 @@ gdk_x11_surface_finalize (GObject *object)
}
g_clear_pointer (&impl->surface_is_on_monitor, g_list_free);
g_clear_handle_id (&impl->compute_size_source_id, g_source_remove);
g_clear_pointer (&impl->toplevel_layout, gdk_toplevel_layout_unref);
g_free (impl->toplevel);

View File

@ -444,6 +444,9 @@ gtk_at_spi_cache_remove_context (GtkAtSpiCache *self,
g_return_if_fail (GTK_IS_AT_SPI_CONTEXT (context));
const char *path = gtk_at_spi_context_get_context_path (context);
if (path == NULL)
return;
if (!g_hash_table_contains (self->contexts_by_path, path))
return;

View File

@ -1631,7 +1631,7 @@ get_bus_address_dbus (GdkDisplay *display)
if (error != NULL)
{
GTK_DEBUG (A11Y, "Unable to acquire session bus: %s", error->message);
g_warning ("Unable to acquire session bus: %s", error->message);
g_error_free (error);
return NULL;
}
@ -1648,8 +1648,10 @@ get_bus_address_dbus (GdkDisplay *display)
&error);
if (error != NULL)
{
GTK_DEBUG (A11Y, "Unable to acquire the address of the accessibility bus: %s",
error->message);
g_warning ("Unable to acquire the address of the accessibility bus: %s. "
"If you are attempting to run GTK without a11y support, "
"GTK_A11Y should be set to 'none'.",
error->message);
g_error_free (error);
}
@ -1732,6 +1734,12 @@ get_bus_address (GdkDisplay *display)
#endif
out:
if (bus_address == NULL)
g_object_set_data_full (G_OBJECT (display), "-gtk-atspi-bus-address",
g_strdup (""),
g_free);
return bus_address;
}

View File

@ -690,7 +690,8 @@ gtk_at_spi_root_constructed (GObject *gobject)
/* No need to validate the path */
self->base_path = g_strconcat (app_path, "/a11y", NULL);
}
else
if (self->base_path == NULL)
{
const char *program_name = g_get_prgname ();

View File

@ -70,6 +70,10 @@ for f in get_files('ui', '.ui'):
xml += '\n'
xml += '''
<file compressed="true">icons/hicolor.index.theme</file>
'''
for s in ['16x16', '32x32', '64x64', 'scalable']:
for c in ['actions', 'categories', 'emblems', 'emotes', 'devices', 'mimetypes', 'places', 'status']:
icons_dir = 'icons/{0}/{1}'.format(s,c)

View File

@ -902,31 +902,6 @@ gtk_at_context_get_accessible_relation (GtkATContext *self,
return gtk_accessible_attribute_set_get_value (self->relations, relation);
}
static gboolean
is_structural_role (GtkAccessibleRole role)
{
/* Keep the switch small while avoiding the compiler warning for
* unhandled enumeration values
*/
switch ((int) role)
{
case GTK_ACCESSIBLE_ROLE_FORM:
case GTK_ACCESSIBLE_ROLE_GROUP:
case GTK_ACCESSIBLE_ROLE_GENERIC:
case GTK_ACCESSIBLE_ROLE_LANDMARK:
case GTK_ACCESSIBLE_ROLE_LIST_ITEM:
case GTK_ACCESSIBLE_ROLE_REGION:
case GTK_ACCESSIBLE_ROLE_SEARCH:
case GTK_ACCESSIBLE_ROLE_SEPARATOR:
return TRUE;
default:
break;
}
return FALSE;
}
/* See the WAI-ARIA § 4.3, "Accessible Name and Description Computation" */
static void
gtk_at_context_get_name_accumulate (GtkATContext *self,
@ -998,13 +973,6 @@ gtk_at_context_get_name_accumulate (GtkATContext *self,
return;
}
/* This fallback is in place only for unlabelled elements */
if (names->len != 0)
return;
/* Ignore structural elements, namely: generic containers */
if (self->accessible != NULL && !is_structural_role (role))
g_ptr_array_add (names, (char *)G_OBJECT_TYPE_NAME (self->accessible));
}
static void

View File

@ -1608,6 +1608,7 @@ create_subparser (GObject *object,
subparser->object = object;
subparser->child = child;
subparser->tagname = g_strdup (element_name);
subparser->level = 1;
subparser->start = element_name;
subparser->parser = g_memdup2 (parser, sizeof (GtkBuildableParser));
subparser->data = user_data;
@ -1638,6 +1639,8 @@ subparser_start (GtkBuildableParseContext *context,
if (subparser->start)
{
subparser->level++;
if (subparser->parser->start_element)
subparser->parser->start_element (context,
element_name, names, values,
@ -1653,6 +1656,8 @@ subparser_end (GtkBuildableParseContext *context,
ParserData *data,
GError **error)
{
data->subparser->level--;
if (data->subparser->parser->end_element)
data->subparser->parser->end_element (context, element_name,
data->subparser->data, error);
@ -1660,9 +1665,11 @@ subparser_end (GtkBuildableParseContext *context,
if (*error)
return;
if (strcmp (data->subparser->start, element_name) != 0)
if (data->subparser->level > 0)
return;
g_assert (strcmp (data->subparser->start, element_name) == 0);
gtk_buildable_custom_tag_end (GTK_BUILDABLE (data->subparser->object),
data->builder,
data->subparser->child,

View File

@ -165,6 +165,7 @@ struct _GtkBuildableParseContext {
typedef struct {
GtkBuildableParser *parser;
char *tagname;
int level;
const char *start;
gpointer data;
GObject *object;

View File

@ -969,10 +969,6 @@ gtk_button_set_icon_name (GtkButton *button,
gtk_image_set_from_icon_name (GTK_IMAGE (priv->child), icon_name);
}
gtk_accessible_update_relation (GTK_ACCESSIBLE (button),
GTK_ACCESSIBLE_RELATION_LABELLED_BY, priv->child, NULL,
-1);
gtk_button_set_child_type (button, ICON_CHILD);
g_object_notify_by_pspec (G_OBJECT (button), props[PROP_ICON_NAME]);
}

View File

@ -1438,7 +1438,8 @@ gtk_calendar_select_day (GtkCalendar *calendar,
else
gtk_widget_remove_css_class (label, "other-month");
if (calendar->marked_date[day-1])
if (calendar->marked_date[day-1] &&
calendar->day_month[y][x] == MONTH_CURRENT)
gtk_widget_set_state_flags (label, GTK_STATE_FLAG_CHECKED, FALSE);
else
gtk_widget_unset_state_flags (label, GTK_STATE_FLAG_CHECKED);
@ -1524,6 +1525,14 @@ gtk_calendar_clear_marks (GtkCalendar *calendar)
g_return_if_fail (GTK_IS_CALENDAR (calendar));
for (int y = 0; y < 6; y ++)
for (int x = 0; x < 7; x ++)
{
GtkWidget *label = calendar->day_number_labels[y][x];
gtk_widget_unset_state_flags (label, GTK_STATE_FLAG_CHECKED);
}
for (day = 0; day < 31; day++)
{
calendar->marked_date[day] = FALSE;
@ -1533,12 +1542,33 @@ gtk_calendar_clear_marks (GtkCalendar *calendar)
calendar_queue_refresh (calendar);
}
static void
update_mark_state (GtkCalendar *calendar,
guint day,
gboolean mark)
{
for (int y = 0; y < 6; y ++)
for (int x = 0; x < 7; x ++)
{
GtkWidget *label = calendar->day_number_labels[y][x];
if (day != calendar->day[y][x])
continue;
if (mark && calendar->marked_date[day-1] &&
calendar->day_month[y][x] == MONTH_CURRENT)
gtk_widget_set_state_flags (label, GTK_STATE_FLAG_CHECKED, FALSE);
else
gtk_widget_unset_state_flags (label, GTK_STATE_FLAG_CHECKED);
}
}
/**
* gtk_calendar_mark_day:
* @calendar: a `GtkCalendar`
* @day: the day number to mark between 1 and 31.
*
* Places a visual marker on a particular day.
* Places a visual marker on a particular day of the current month.
*/
void
gtk_calendar_mark_day (GtkCalendar *calendar,
@ -1550,6 +1580,7 @@ gtk_calendar_mark_day (GtkCalendar *calendar,
{
calendar->marked_date[day - 1] = TRUE;
calendar->num_marked_dates++;
update_mark_state (calendar, day, TRUE);
calendar_invalidate_day_num (calendar, day);
}
}
@ -1592,6 +1623,7 @@ gtk_calendar_unmark_day (GtkCalendar *calendar,
{
calendar->marked_date[day - 1] = FALSE;
calendar->num_marked_dates--;
update_mark_state (calendar, day, FALSE);
calendar_invalidate_day_num (calendar, day);
}
}

View File

@ -65,10 +65,11 @@ gtk_column_list_item_factory_setup (GtkListItemFactory *factory,
{
GtkColumnViewColumn *column = g_list_model_get_item (columns, i);
gtk_column_list_item_factory_add_column (self,
widget,
column,
FALSE);
if (gtk_column_view_column_get_visible (column))
gtk_column_list_item_factory_add_column (self,
widget,
column,
FALSE);
g_object_unref (column);
}

View File

@ -659,6 +659,8 @@ gtk_column_view_class_init (GtkColumnViewClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gpointer iface;
widget_class->focus = gtk_widget_focus_child;
widget_class->grab_focus = gtk_widget_grab_focus_child;
widget_class->measure = gtk_column_view_measure;
widget_class->size_allocate = gtk_column_view_allocate;
@ -1314,7 +1316,6 @@ gtk_column_view_init (GtkColumnView *self)
g_quark_from_static_string (I_("view")));
gtk_widget_set_overflow (GTK_WIDGET (self), GTK_OVERFLOW_HIDDEN);
gtk_widget_set_focusable (GTK_WIDGET (self), TRUE);
self->reorderable = TRUE;
}

View File

@ -551,7 +551,8 @@ gtk_column_view_column_remove_header (GtkColumnViewColumn *self)
static void
gtk_column_view_column_ensure_cells (GtkColumnViewColumn *self)
{
if (self->view && gtk_widget_get_root (GTK_WIDGET (self->view)))
if (self->view && gtk_widget_get_root (GTK_WIDGET (self->view)) &&
gtk_column_view_column_get_visible (self))
gtk_column_view_column_create_cells (self);
else
gtk_column_view_column_remove_cells (self);
@ -787,8 +788,6 @@ void
gtk_column_view_column_set_visible (GtkColumnViewColumn *self,
gboolean visible)
{
GtkColumnViewCell *cell;
g_return_if_fail (GTK_IS_COLUMN_VIEW_COLUMN (self));
if (self->visible == visible)
@ -802,10 +801,7 @@ gtk_column_view_column_set_visible (GtkColumnViewColumn *self,
if (self->header)
gtk_widget_set_visible (GTK_WIDGET (self->header), visible);
for (cell = self->first_cell; cell; cell = gtk_column_view_cell_get_next (cell))
{
gtk_widget_set_visible (GTK_WIDGET (cell), visible);
}
gtk_column_view_column_ensure_cells (self);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_VISIBLE]);
}

View File

@ -250,6 +250,18 @@ click_released_cb (GtkGestureClick *gesture,
show_menu (self, x, y);
}
static void
click_pressed_cb (GtkGestureClick *gesture,
int n_press,
double x,
double y,
GtkColumnView *self)
{
/* Claim the state here to prevent propagation, the event controllers in
* GtkColumView have already been handled in the CAPTURE phase */
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
}
static void
gtk_column_view_title_init (GtkColumnViewTitle *self)
{
@ -272,6 +284,7 @@ gtk_column_view_title_init (GtkColumnViewTitle *self)
gesture = gtk_gesture_click_new ();
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0);
g_signal_connect (gesture, "released", G_CALLBACK (click_released_cb), self);
g_signal_connect (gesture, "pressed", G_CALLBACK (click_pressed_cb), self);
gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (gesture));
}

View File

@ -937,9 +937,12 @@ gtk_css_animated_style_new_advance (GtkCssAnimatedStyle *source,
gtk_internal_return_val_if_fail (GTK_IS_CSS_ANIMATED_STYLE (source), NULL);
gtk_internal_return_val_if_fail (GTK_IS_CSS_STYLE (base_style), NULL);
if (timestamp == 0 || timestamp == source->current_time)
if (timestamp == 0)
return g_object_ref (source->style);
if (timestamp == source->current_time)
return g_object_ref (GTK_CSS_STYLE (source));
gtk_internal_return_val_if_fail (timestamp > source->current_time, NULL);
animations = NULL;

View File

@ -292,9 +292,13 @@ gtk_drop_target_load_local (GtkDropTarget *self,
if (gdk_content_provider_get_value (gdk_drag_get_content (drag),
&self->value,
NULL))
return TRUE;
{
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_VALUE]);
return TRUE;
}
g_value_unset (&self->value);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_VALUE]);
return FALSE;
}

View File

@ -72,6 +72,8 @@ struct _GtkEditableLabel
GtkWidget *stack;
GtkWidget *label;
GtkWidget *entry;
guint stop_editing_soon_id;
};
struct _GtkEditableLabelClass
@ -192,11 +194,26 @@ gtk_editable_label_prepare_drag (GtkDragSource *source,
gtk_label_get_label (GTK_LABEL (self->label)));
}
static gboolean
stop_editing_soon (gpointer data)
{
GtkEventController *controller = data;
GtkEditableLabel *self = GTK_EDITABLE_LABEL (gtk_event_controller_get_widget (controller));
if (!gtk_event_controller_focus_contains_focus (GTK_EVENT_CONTROLLER_FOCUS (controller)))
gtk_editable_label_stop_editing (self, TRUE);
self->stop_editing_soon_id = 0;
return FALSE;
}
static void
gtk_editable_label_focus_out (GtkEventController *controller,
GtkEditableLabel *self)
{
gtk_editable_label_stop_editing (self, TRUE);
if (self->stop_editing_soon_id == 0)
self->stop_editing_soon_id = g_timeout_add (100, stop_editing_soon, controller);
}
static void
@ -349,6 +366,8 @@ gtk_editable_label_dispose (GObject *object)
self->entry = NULL;
self->label = NULL;
g_clear_handle_id (&self->stop_editing_soon_id, g_source_remove);
G_OBJECT_CLASS (gtk_editable_label_parent_class)->dispose (object);
}

View File

@ -600,6 +600,10 @@ filechooser_win32_thread (gpointer _data)
if (FAILED (hr))
g_warning_hr ("Can't set file types", hr);
hr = IFileDialog_SetDefaultExtension (pfd, L"");
if (FAILED (hr))
g_warning_hr ("Can't set default extension", hr);
if (data->self->current_filter)
{
GListModel *filters;

View File

@ -1704,49 +1704,6 @@ gtk_icon_theme_get_theme_name (GtkIconTheme *self)
return theme_name;
}
static const char builtin_hicolor_index[] =
"[Icon Theme]\n"
"Name=Hicolor\n"
"Hidden=True\n"
"Directories=16x16/actions,16x16/status,22x22/actions,24x24/actions,24x24/status,32x32/actions,32x32/status,48x48/status,64x64/actions,scalable/status,scalable/actions\n"
"[16x16/actions]\n"
"Size=16\n"
"Type=Threshold\n"
"[16x16/status]\n"
"Size=16\n"
"Type=Threshold\n"
"[22x22/actions]\n"
"Size=22\n"
"Type=Threshold\n"
"[24x24/actions]\n"
"Size=24\n"
"Type=Threshold\n"
"[24x24/status]\n"
"Size=24\n"
"Type=Threshold\n"
"[32x32/actions]\n"
"Size=32\n"
"Type=Threshold\n"
"[32x32/status]\n"
"Size=32\n"
"Type=Threshold\n"
"[48x48/status]\n"
"Size=48\n"
"Type=Threshold\n"
"[64x64/actions]\n"
"Size=64\n"
"Type=Threshold\n"
"[scalable/status]\n"
"MinSize=1\n"
"Size=128\n"
"MaxSize=256\n"
"Type=Scalable\n"
"[scalable/actions]\n"
"MinSize=1\n"
"Size=128\n"
"MaxSize=256\n"
"Type=Scalable\n";
static void
insert_theme (GtkIconTheme *self,
const char *theme_name)
@ -1813,9 +1770,20 @@ insert_theme (GtkIconTheme *self,
{
if (strcmp (theme_name, FALLBACK_ICON_THEME) == 0)
{
const char *resource_path = "/org/gtk/libgtk/icons/hicolor.index.theme";
GBytes *index;
index = g_resources_lookup_data (resource_path,
G_RESOURCE_LOOKUP_FLAGS_NONE,
NULL);
if (!index)
g_error ("Cannot find resource %s", resource_path);
theme_file = g_key_file_new ();
g_key_file_set_list_separator (theme_file, ',');
g_key_file_load_from_data (theme_file, builtin_hicolor_index, -1, 0, NULL);
g_key_file_load_from_bytes (theme_file, index, G_KEY_FILE_NONE, NULL);
g_bytes_unref (index);
}
else
return;

View File

@ -607,7 +607,8 @@ gtk_im_context_filter_key (GtkIMContext *context,
state,
FALSE, /* FIXME */
&translated,
&no_lock);
&no_lock,
NULL);
ret = GTK_IM_CONTEXT_GET_CLASS (context)->filter_keypress (context, key);

View File

@ -34,6 +34,7 @@
#include "imm-extra.h"
#include "gdk/gdkkeysyms.h"
#include "gdk/gdkeventsprivate.h"
#include "gdk/win32/gdkwin32.h"
#include "gtk/gtkimmodule.h"
#include "gtk/gtkstylecontextprivate.h"
@ -61,9 +62,6 @@ typedef enum {
GTK_WIN32_IME_FOCUS_BEHAVIOR_FOLLOW,
} GtkWin32IMEFocusBehavior;
#define IS_DEAD_KEY(k) \
((k) >= GDK_KEY_dead_grave && (k) <= (GDK_KEY_dead_dasia+1))
struct _GtkIMContextIMEPrivate
{
/* When pretend_empty_preedit is set to TRUE,
@ -81,7 +79,6 @@ struct _GtkIMContextIMEPrivate
* https://gitlab.gnome.org/GNOME/gtk/commit/c255ba68fc2c918dd84da48a472e7973d3c00b03
*/
gboolean pretend_empty_preedit;
guint32 dead_key_keyval;
GtkWin32IMEFocusBehavior focus_behavior;
};
@ -277,134 +274,26 @@ gtk_im_context_ime_set_client_widget (GtkIMContext *context,
context_ime->client_surface = surface;
}
static gunichar
_gtk_im_context_ime_dead_key_unichar (guint keyval,
gboolean spacing)
{
switch (keyval)
{
#define CASE(keysym, unicode, spacing_unicode) \
case GDK_KEY_dead_##keysym: return (spacing) ? spacing_unicode : unicode;
CASE (grave, 0x0300, 0x0060);
CASE (acute, 0x0301, 0x00b4);
CASE (circumflex, 0x0302, 0x005e);
CASE (tilde, 0x0303, 0x007e); /* Also used with perispomeni, 0x342. */
CASE (macron, 0x0304, 0x00af);
CASE (breve, 0x0306, 0x02d8);
CASE (abovedot, 0x0307, 0x02d9);
CASE (diaeresis, 0x0308, 0x00a8);
CASE (hook, 0x0309, 0);
CASE (abovering, 0x030A, 0x02da);
CASE (doubleacute, 0x030B, 0x2dd);
CASE (caron, 0x030C, 0x02c7);
CASE (abovecomma, 0x0313, 0); /* Equivalent to psili */
CASE (abovereversedcomma, 0x0314, 0); /* Equivalent to dasia */
CASE (horn, 0x031B, 0); /* Legacy use for psili, 0x313 (or 0x343). */
CASE (belowdot, 0x0323, 0);
CASE (cedilla, 0x0327, 0x00b8);
CASE (ogonek, 0x0328, 0); /* Legacy use for dasia, 0x314.*/
CASE (iota, 0x0345, 0);
#undef CASE
default:
return 0;
}
}
static void
_gtk_im_context_ime_commit_unichar (GtkIMContextIME *context_ime,
gunichar c)
{
char utf8[10];
int len;
if (context_ime->priv->dead_key_keyval != 0)
{
gunichar combining;
combining =
_gtk_im_context_ime_dead_key_unichar (context_ime->priv->dead_key_keyval,
FALSE);
g_unichar_compose (c, combining, &c);
}
len = g_unichar_to_utf8 (c, utf8);
utf8[len] = 0;
g_signal_emit_by_name (context_ime, "commit", utf8);
context_ime->priv->dead_key_keyval = 0;
}
static gboolean
gtk_im_context_ime_filter_keypress (GtkIMContext *context,
GdkEvent *event)
{
GtkIMContextIME *context_ime;
gboolean retval = FALSE;
guint32 c;
GdkModifierType state, consumed_modifiers, no_text_input_mask;
guint keyval;
char *compose_sequence = NULL;
g_return_val_if_fail (GTK_IS_IM_CONTEXT_IME (context), FALSE);
g_return_val_if_fail (event, FALSE);
if (gdk_event_get_event_type ((GdkEvent *) event) == GDK_KEY_RELEASE)
return FALSE;
no_text_input_mask = GDK_ALT_MASK|GDK_CONTROL_MASK;
state = gdk_event_get_modifier_state ((GdkEvent *) event);
consumed_modifiers = gdk_key_event_get_consumed_modifiers (event);
if (state & no_text_input_mask & ~consumed_modifiers)
return FALSE;
context_ime = GTK_IM_CONTEXT_IME (context);
if (!context_ime->focus)
return FALSE;
if (!GDK_IS_SURFACE (context_ime->client_surface))
return FALSE;
keyval = gdk_key_event_get_keyval ((GdkEvent *) event);
if (keyval == GDK_KEY_space &&
context_ime->priv->dead_key_keyval != 0)
compose_sequence = gdk_key_event_get_compose_sequence (event);
if (compose_sequence)
{
c = _gtk_im_context_ime_dead_key_unichar (context_ime->priv->dead_key_keyval, TRUE);
context_ime->priv->dead_key_keyval = 0;
_gtk_im_context_ime_commit_unichar (context_ime, c);
g_signal_emit_by_name (context_ime, "commit", compose_sequence);
return TRUE;
}
c = gdk_keyval_to_unicode (keyval);
if (c && !g_unichar_iscntrl(c))
{
_gtk_im_context_ime_commit_unichar (context_ime, c);
retval = TRUE;
}
else if (IS_DEAD_KEY (keyval))
{
gunichar dead_key;
dead_key = _gtk_im_context_ime_dead_key_unichar (keyval, FALSE);
/* Emulate double input of dead keys */
if (dead_key && keyval == context_ime->priv->dead_key_keyval)
{
c = _gtk_im_context_ime_dead_key_unichar (context_ime->priv->dead_key_keyval, TRUE);
context_ime->priv->dead_key_keyval = 0;
_gtk_im_context_ime_commit_unichar (context_ime, c);
_gtk_im_context_ime_commit_unichar (context_ime, c);
}
else
context_ime->priv->dead_key_keyval = keyval;
}
return retval;
return FALSE;
}

View File

@ -663,7 +663,8 @@ no_sequence_matches (GtkIMContextSimple *context_simple,
gdk_event_get_modifier_state (event),
FALSE,
&translated,
&translated);
&translated,
NULL);
gtk_im_context_filter_keypress (context, tmp_event);
gdk_event_unref (tmp_event);

View File

@ -133,7 +133,7 @@ istring_prepend (IString *str,
if (!istring_is_inline (str))
old = str->u.str;
str->u.str = g_strconcat (istring_str (str), istring_str (other), NULL);
str->u.str = g_strconcat (istring_str (other), istring_str (str), NULL);
str->n_bytes += other->n_bytes;
str->n_chars += other->n_chars;

View File

@ -569,6 +569,20 @@ gtk_list_base_focus (GtkWidget *widget,
return gtk_widget_child_focus (item->widget, direction);
}
static gboolean
gtk_list_base_grab_focus (GtkWidget *widget)
{
GtkListBase *self = GTK_LIST_BASE (widget);
GtkListBasePrivate *priv = gtk_list_base_get_instance_private (self);
guint pos;
pos = gtk_list_item_tracker_get_position (priv->item_manager, priv->focus);
if (gtk_list_base_grab_focus_on_item (self, pos, FALSE, FALSE, FALSE))
return TRUE;
return GTK_WIDGET_CLASS (gtk_list_base_parent_class)->grab_focus (widget);
}
static void
gtk_list_base_dispose (GObject *object)
{
@ -789,43 +803,13 @@ gtk_list_base_compute_scroll_align (GtkListBase *self,
}
static void
gtk_list_base_update_focus_tracker (GtkListBase *self)
gtk_list_base_scroll_to_item (GtkListBase *self,
guint pos)
{
GtkListBasePrivate *priv = gtk_list_base_get_instance_private (self);
GtkWidget *focus_child;
guint pos;
focus_child = gtk_widget_get_focus_child (GTK_WIDGET (self));
if (!GTK_IS_LIST_ITEM_WIDGET (focus_child))
return;
pos = gtk_list_item_widget_get_position (GTK_LIST_ITEM_WIDGET (focus_child));
if (pos != gtk_list_item_tracker_get_position (priv->item_manager, priv->focus))
{
gtk_list_item_tracker_set_position (priv->item_manager,
priv->focus,
pos,
0,
0);
}
}
static void
gtk_list_base_scroll_to_item (GtkWidget *widget,
const char *action_name,
GVariant *parameter)
{
GtkListBase *self = GTK_LIST_BASE (widget);
GtkListBasePrivate *priv = gtk_list_base_get_instance_private (self);
int start, end;
double align_along, align_across;
GtkPackType side_along, side_across;
guint pos;
if (!g_variant_check_format_string (parameter, "u", FALSE))
return;
g_variant_get (parameter, "u", &pos);
/* figure out primary orientation and if position is valid */
if (!gtk_list_base_get_allocation_along (GTK_LIST_BASE (self), pos, &start, &end))
@ -853,14 +837,48 @@ gtk_list_base_scroll_to_item (GtkWidget *widget,
pos,
align_across, side_across,
align_along, side_along);
}
/* HACK HACK HACK
*
* GTK has no way to track the focused child. But we now that when a listitem
* gets focus, it calls this action. So we update our focus tracker from here
* because it's the closest we can get to accurate tracking.
*/
gtk_list_base_update_focus_tracker (self);
static void
gtk_list_base_scroll_to_item_action (GtkWidget *widget,
const char *action_name,
GVariant *parameter)
{
GtkListBase *self = GTK_LIST_BASE (widget);
guint pos;
if (!g_variant_check_format_string (parameter, "u", FALSE))
return;
g_variant_get (parameter, "u", &pos);
gtk_list_base_scroll_to_item (self, pos);
}
static void
gtk_list_base_set_focus_child (GtkWidget *widget,
GtkWidget *child)
{
GtkListBase *self = GTK_LIST_BASE (widget);
GtkListBasePrivate *priv = gtk_list_base_get_instance_private (self);
guint pos;
GTK_WIDGET_CLASS (gtk_list_base_parent_class)->set_focus_child (widget, child);
if (!GTK_IS_LIST_ITEM_WIDGET (child))
return;
pos = gtk_list_item_widget_get_position (GTK_LIST_ITEM_WIDGET (child));
if (pos != gtk_list_item_tracker_get_position (priv->item_manager, priv->focus))
{
gtk_list_base_scroll_to_item (self, pos);
gtk_list_item_tracker_set_position (priv->item_manager,
priv->focus,
pos,
0,
0);
}
}
static void
@ -1120,6 +1138,8 @@ gtk_list_base_class_init (GtkListBaseClass *klass)
gpointer iface;
widget_class->focus = gtk_list_base_focus;
widget_class->grab_focus = gtk_list_base_grab_focus;
widget_class->set_focus_child = gtk_list_base_set_focus_child;
gobject_class->dispose = gtk_list_base_dispose;
gobject_class->get_property = gtk_list_base_get_property;
@ -1164,7 +1184,7 @@ gtk_list_base_class_init (GtkListBaseClass *klass)
gtk_widget_class_install_action (widget_class,
"list.scroll-to-item",
"u",
gtk_list_base_scroll_to_item);
gtk_list_base_scroll_to_item_action);
/**
* GtkListBase|list.select-item:
@ -1552,25 +1572,16 @@ gtk_list_base_start_rubberband (GtkListBase *self,
}
static void
gtk_list_base_stop_rubberband (GtkListBase *self,
gboolean modify,
gboolean extend)
gtk_list_base_apply_rubberband_selection (GtkListBase *self,
gboolean modify,
gboolean extend)
{
GtkListBasePrivate *priv = gtk_list_base_get_instance_private (self);
GtkListItemManagerItem *item;
GtkSelectionModel *model;
if (!priv->rubberband)
return;
for (item = gtk_list_item_manager_get_first (priv->item_manager);
item != NULL;
item = gtk_rb_tree_node_get_next (item))
{
if (item->widget)
gtk_widget_unset_state_flags (item->widget, GTK_STATE_FLAG_ACTIVE);
}
model = gtk_list_item_manager_get_model (priv->item_manager);
if (model != NULL)
{
@ -1631,6 +1642,24 @@ gtk_list_base_stop_rubberband (GtkListBase *self,
gtk_bitset_unref (mask);
gtk_bitset_unref (rubberband_selection);
}
}
static void
gtk_list_base_stop_rubberband (GtkListBase *self)
{
GtkListBasePrivate *priv = gtk_list_base_get_instance_private (self);
GtkListItemManagerItem *item;
if (!priv->rubberband)
return;
for (item = gtk_list_item_manager_get_first (priv->item_manager);
item != NULL;
item = gtk_rb_tree_node_get_next (item))
{
if (item->widget)
gtk_widget_unset_state_flags (item->widget, GTK_STATE_FLAG_ACTIVE);
}
gtk_list_item_tracker_free (priv->item_manager, priv->rubberband->start_tracker);
g_clear_pointer (&priv->rubberband->widget, gtk_widget_unparent);
@ -1743,14 +1772,23 @@ gtk_list_base_drag_end (GtkGestureDrag *gesture,
GtkListBase *self)
{
GtkListBasePrivate *priv = gtk_list_base_get_instance_private (self);
GdkEventSequence *sequence;
gboolean modify, extend;
if (!priv->rubberband)
return;
sequence = gtk_gesture_get_last_updated_sequence (GTK_GESTURE (gesture));
if (!gtk_gesture_handles_sequence (GTK_GESTURE (gesture), sequence))
{
gtk_list_base_stop_rubberband (self);
return;
}
gtk_list_base_drag_update (gesture, offset_x, offset_y, self);
get_selection_modifiers (GTK_GESTURE (gesture), &modify, &extend);
gtk_list_base_stop_rubberband (self, modify, extend);
gtk_list_base_apply_rubberband_selection (self, modify, extend);
gtk_list_base_stop_rubberband (self);
}
void

View File

@ -22,7 +22,6 @@
#include "gtklistitemwidgetprivate.h"
#include "gtkbinlayout.h"
#include "gtkeventcontrollerfocus.h"
#include "gtkeventcontrollermotion.h"
#include "gtkgestureclick.h"
#include "gtklistitemfactoryprivate.h"
@ -467,19 +466,6 @@ gtk_list_item_widget_click_gesture_released (GtkGestureClick *gesture,
gtk_widget_unset_state_flags (GTK_WIDGET (self), GTK_STATE_FLAG_ACTIVE);
}
static void
gtk_list_item_widget_enter_cb (GtkEventControllerFocus *controller,
GtkListItemWidget *self)
{
GtkWidget *widget = GTK_WIDGET (self);
GtkListItemWidgetPrivate *priv = gtk_list_item_widget_get_instance_private (self);
gtk_widget_activate_action (widget,
"list.scroll-to-item",
"u",
priv->position);
}
static void
gtk_list_item_widget_hover_cb (GtkEventControllerMotion *controller,
double x,
@ -531,10 +517,6 @@ gtk_list_item_widget_init (GtkListItemWidget *self)
G_CALLBACK (gtk_list_item_widget_click_gesture_canceled), self);
gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (gesture));
controller = gtk_event_controller_focus_new ();
g_signal_connect (controller, "enter", G_CALLBACK (gtk_list_item_widget_enter_cb), self);
gtk_widget_add_controller (GTK_WIDGET (self), controller);
controller = gtk_event_controller_motion_new ();
g_signal_connect (controller, "enter", G_CALLBACK (gtk_list_item_widget_hover_cb), self);
gtk_widget_add_controller (GTK_WIDGET (self), controller);

View File

@ -1084,7 +1084,8 @@ rewrite_event_for_toplevel (GdkEvent *event)
gdk_key_event_get_keycode (event),
gdk_event_get_modifier_state (event),
gdk_key_event_is_modifier (event),
key, key_no_lock);
key, key_no_lock,
gdk_key_event_get_compose_sequence (event));
}
static gboolean

View File

@ -812,6 +812,8 @@ update_accel (GtkModelButton *self,
"css-name", "accelerator",
NULL);
gtk_widget_insert_before (self->accel_label, GTK_WIDGET (self), NULL);
gtk_widget_set_hexpand (self->accel_label, TRUE),
gtk_widget_set_halign (self->accel_label, GTK_ALIGN_END);
}
gtk_accelerator_parse (accel, &key, &mods);

View File

@ -543,32 +543,35 @@ _gtk_mount_operation_lookup_context_get (GdkDisplay *display)
context->pid_to_window = g_hash_table_new (g_direct_hash, g_direct_equal);
context->display = display;
mapping = NULL;
mapping_length = 0;
get_window_list (context->display,
gdk_x11_display_get_xdisplay (context->display),
gdk_x11_display_get_xrootwindow (context->display),
gdk_x11_get_xatom_by_name_for_display (context->display,
"_NET_CLIENT_LIST"),
&mapping,
&mapping_length);
for (n = 0; n < mapping_length; n++)
if (GDK_IS_X11_DISPLAY (display))
{
int pid;
mapping = NULL;
mapping_length = 0;
get_window_list (context->display,
gdk_x11_display_get_xdisplay (context->display),
gdk_x11_display_get_xrootwindow (context->display),
gdk_x11_get_xatom_by_name_for_display (context->display,
"_NET_CLIENT_LIST"),
&mapping,
&mapping_length);
for (n = 0; n < mapping_length; n++)
{
int pid;
if (!get_cardinal (context->display,
GDK_DISPLAY_XDISPLAY (context->display),
mapping[n],
gdk_x11_get_xatom_by_name_for_display (context->display,
"_NET_WM_PID"),
&pid))
continue;
if (!get_cardinal (context->display,
GDK_DISPLAY_XDISPLAY (context->display),
mapping[n],
gdk_x11_get_xatom_by_name_for_display (context->display,
"_NET_WM_PID"),
&pid))
continue;
g_hash_table_insert (context->pid_to_window,
GINT_TO_POINTER (pid),
GINT_TO_POINTER ((int) mapping[n]));
g_hash_table_insert (context->pid_to_window,
GINT_TO_POINTER (pid),
GINT_TO_POINTER ((int) mapping[n]));
}
g_free (mapping);
}
g_free (mapping);
return context;
}
@ -1001,6 +1004,9 @@ _gtk_mount_operation_lookup_info (GtkMountOperationLookupContext *context,
g_return_val_if_fail (out_command_line != NULL && *out_command_line == NULL, FALSE);
g_return_val_if_fail (out_texture != NULL && *out_texture == NULL, FALSE);
if (!GDK_IS_X11_DISPLAY (context->display))
return FALSE;
/* We perform two different lookups for name and icon size.. this is
* because we want the name from the window with WINDOWID and this
* normally does not give you an icon

View File

@ -41,26 +41,22 @@
#include "gtkcheckbutton.h"
#include "gtkgrid.h"
#include "gtkwindow.h"
#include "gtktreeview.h"
#include "gtktreeselection.h"
#include "gtkcellrenderertext.h"
#include "gtkcellrendererpixbuf.h"
#include "gtkscrolledwindow.h"
#include "gtkicontheme.h"
#include "gtkmain.h"
#include "gtksettings.h"
#include "gtkdialogprivate.h"
#include "gtkgestureclick.h"
#include "gtkmodelbuttonprivate.h"
#include "gtkpopover.h"
#include "gtksnapshot.h"
#include "gdktextureprivate.h"
#include "gtkshortcutcontroller.h"
#include "gtkshortcuttrigger.h"
#include "gtkshortcutaction.h"
#include "gtkshortcut.h"
#include "gtkliststore.h"
#include <glib/gprintf.h>
#include "gtklistview.h"
#include "gtksignallistitemfactory.h"
#include "gtklistitem.h"
#include "gtksingleselection.h"
#include "gtkpicture.h"
/**
* GtkMountOperation:
@ -133,8 +129,8 @@ struct _GtkMountOperationPrivate {
gboolean anonymous;
/* for the show-processes dialog */
GtkWidget *process_tree_view;
GtkListStore *process_list_store;
GtkWidget *process_list_view;
GListStore *process_list_store;
};
enum {
@ -1064,12 +1060,17 @@ gtk_mount_operation_ask_question (GMountOperation *op,
}
static void
show_processes_button_clicked (GtkDialog *dialog,
int button_number,
show_processes_button_clicked (GtkWidget *button,
GMountOperation *op)
{
GtkMountOperationPrivate *priv;
GtkMountOperation *operation;
int button_number;
GtkDialog *dialog;
button_number = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "choice"));
dialog = GTK_DIALOG (gtk_widget_get_ancestor (button, GTK_TYPE_DIALOG));
operation = GTK_MOUNT_OPERATION (op);
priv = operation->priv;
@ -1180,17 +1181,70 @@ render_paintable_to_texture (GdkPaintable *paintable)
return texture;
}
typedef struct _ProcessData ProcessData;
G_DECLARE_FINAL_TYPE (ProcessData, process_data, PROCESS, DATA, GObject);
struct _ProcessData
{
GObject parent;
GdkTexture *texture;
char *name;
GPid pid;
};
G_DEFINE_TYPE (ProcessData, process_data, G_TYPE_OBJECT);
static void
process_data_init (ProcessData *self)
{
}
static void
process_data_finalize (GObject *object)
{
ProcessData *pd = PROCESS_DATA (object);
g_free (pd->name);
g_object_unref (pd->texture);
G_OBJECT_CLASS (process_data_parent_class)->finalize (object);
}
static void
process_data_class_init (ProcessDataClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
object_class->finalize = process_data_finalize;
}
static ProcessData *
process_data_new (const char *name,
GPid pid,
GdkTexture *texture)
{
ProcessData *self;
self = g_object_new (process_data_get_type (), NULL);
self->name = g_strdup (name);
self->pid = pid;
g_set_object (&self->texture, texture);
return self;
}
static void
add_pid_to_process_list_store (GtkMountOperation *mount_operation,
GtkMountOperationLookupContext *lookup_context,
GtkListStore *list_store,
GListStore *list_store,
GPid pid)
{
char *command_line;
char *name;
GdkTexture *texture;
char *markup;
GtkTreeIter iter;
name = NULL;
texture = NULL;
@ -1229,12 +1283,7 @@ add_pid_to_process_list_store (GtkMountOperation *mount_operation,
name,
command_line);
gtk_list_store_append (list_store, &iter);
gtk_list_store_set (list_store, &iter,
0, texture,
1, markup,
2, pid,
-1);
g_list_store_append (list_store, process_data_new (markup, pid, texture));
if (texture != NULL)
g_object_unref (texture);
@ -1245,35 +1294,27 @@ add_pid_to_process_list_store (GtkMountOperation *mount_operation,
static void
remove_pid_from_process_list_store (GtkMountOperation *mount_operation,
GtkListStore *list_store,
GListStore *list_store,
GPid pid)
{
GtkTreeIter iter;
GPid pid_of_item;
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (list_store), &iter))
for (guint i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (list_store)); i++)
{
do
{
gtk_tree_model_get (GTK_TREE_MODEL (list_store),
&iter,
2, &pid_of_item,
-1);
ProcessData *data = g_list_model_get_item (G_LIST_MODEL (list_store), i);
if (pid_of_item == pid)
{
gtk_list_store_remove (list_store, &iter);
break;
}
g_object_unref (data);
if (data->pid == pid)
{
g_list_store_remove (list_store, i);
break;
}
while (gtk_tree_model_iter_next (GTK_TREE_MODEL (list_store), &iter));
}
}
static void
update_process_list_store (GtkMountOperation *mount_operation,
GtkListStore *list_store,
GListStore *list_store,
GArray *processes)
{
guint n;
@ -1281,7 +1322,6 @@ update_process_list_store (GtkMountOperation *mount_operation,
GArray *current_pids;
GArray *pid_indices_to_add;
GArray *pid_indices_to_remove;
GtkTreeIter iter;
GPid pid;
/* Just removing all items and adding new ones will screw up the
@ -1292,18 +1332,13 @@ update_process_list_store (GtkMountOperation *mount_operation,
pid_indices_to_add = g_array_new (FALSE, FALSE, sizeof (int));
pid_indices_to_remove = g_array_new (FALSE, FALSE, sizeof (int));
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (list_store), &iter))
for (guint i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (list_store)); i++)
{
do
{
gtk_tree_model_get (GTK_TREE_MODEL (list_store),
&iter,
2, &pid,
-1);
ProcessData *data = g_list_model_get_item (G_LIST_MODEL (list_store), i);
g_array_append_val (current_pids, pid);
}
while (gtk_tree_model_iter_next (GTK_TREE_MODEL (list_store), &iter));
g_array_append_val (current_pids, data->pid);
g_object_unref (data);
}
g_array_sort (current_pids, pid_equal);
@ -1319,7 +1354,7 @@ update_process_list_store (GtkMountOperation *mount_operation,
if (pid_indices_to_add->len > 0)
{
lookup_context = _gtk_mount_operation_lookup_context_get (gtk_widget_get_display (mount_operation->priv->process_tree_view));
lookup_context = _gtk_mount_operation_lookup_context_get (gtk_widget_get_display (mount_operation->priv->process_list_view));
for (n = 0; n < pid_indices_to_add->len; n++)
{
pid = g_array_index (processes, GPid, n);
@ -1328,17 +1363,6 @@ update_process_list_store (GtkMountOperation *mount_operation,
_gtk_mount_operation_lookup_context_free (lookup_context);
}
/* select the first item, if we went from a zero to a non-zero amount of processes */
if (current_pids->len == 0 && pid_indices_to_add->len > 0)
{
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (list_store), &iter))
{
GtkTreeSelection *tree_selection;
tree_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (mount_operation->priv->process_tree_view));
gtk_tree_selection_select_iter (tree_selection, &iter);
}
}
g_array_unref (current_pids);
g_array_unref (pid_indices_to_add);
g_array_unref (pid_indices_to_remove);
@ -1357,26 +1381,18 @@ on_dialog_response (GtkDialog *dialog,
}
static void
on_end_process_activated (GtkModelButton *button,
gpointer user_data)
on_end_process_activated (GtkButton *button,
GtkMountOperation *op)
{
GtkMountOperation *op = GTK_MOUNT_OPERATION (user_data);
GtkTreeSelection *selection;
GtkTreeIter iter;
GPid pid_to_kill;
GtkSelectionModel *selection;
ProcessData *data;
GError *error;
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (op->priv->process_tree_view));
if (!gtk_tree_selection_get_selected (selection,
NULL,
&iter))
selection = gtk_list_view_get_model (GTK_LIST_VIEW (op->priv->process_list_view));
if (gtk_single_selection_get_selected (GTK_SINGLE_SELECTION (selection)) == GTK_INVALID_LIST_POSITION)
goto out;
gtk_tree_model_get (GTK_TREE_MODEL (op->priv->process_list_store),
&iter,
2, &pid_to_kill,
-1);
data = gtk_single_selection_get_selected_item (GTK_SINGLE_SELECTION (selection));
/* TODO: We might want to either
*
@ -1389,7 +1405,7 @@ on_end_process_activated (GtkModelButton *button,
* But that's not how things work right now....
*/
error = NULL;
if (!_gtk_mount_operation_kill_process (pid_to_kill, &error))
if (!_gtk_mount_operation_kill_process (data->pid, &error))
{
GtkWidget *dialog;
@ -1418,82 +1434,38 @@ on_end_process_activated (GtkModelButton *button,
;
}
static gboolean
do_popup_menu_for_process_tree_view (GtkWidget *widget,
GdkEvent *event,
GtkMountOperation *op)
static void
setup_process_row (GtkListItemFactory *factory,
GtkListItem *item)
{
GtkWidget *menu;
GtkWidget *item;
double x, y;
GtkWidget *box, *picture, *label;
menu = gtk_popover_new ();
gtk_widget_set_parent (menu, widget);
gtk_widget_add_css_class (menu, "context-menu");
picture = gtk_picture_new ();
label = gtk_label_new (NULL);
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_MIDDLE);
item = gtk_model_button_new ();
g_object_set (item, "text", _("_End Process"), NULL);
g_signal_connect (item, "clicked",
G_CALLBACK (on_end_process_activated),
op);
gtk_box_append (GTK_BOX (menu), item);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_box_append (GTK_BOX (box), picture);
gtk_box_append (GTK_BOX (box), label);
if (event && gdk_event_triggers_context_menu (event))
{
GtkTreePath *path;
GtkTreeSelection *selection;
gdk_event_get_position (event, &x, &y);
if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (op->priv->process_tree_view),
(int) x,
(int) y,
&path,
NULL,
NULL,
NULL))
{
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (op->priv->process_tree_view));
gtk_tree_selection_select_path (selection, path);
gtk_tree_path_free (path);
}
else
{
/* don't popup a menu if the user right-clicked in an area with no rows */
return FALSE;
}
gtk_popover_set_pointing_to (GTK_POPOVER (menu), &(GdkRectangle){ x, y, 1, 1});
}
gtk_popover_popup (GTK_POPOVER (menu));
return TRUE;
}
static gboolean
on_popup_menu_for_process_tree_view (GtkWidget *widget,
GVariant *args,
gpointer user_data)
{
GtkMountOperation *op = GTK_MOUNT_OPERATION (user_data);
return do_popup_menu_for_process_tree_view (widget, NULL, op);
gtk_list_item_set_child (item, box);
}
static void
click_cb (GtkGesture *gesture,
int n_press,
double x,
double y,
gpointer user_data)
bind_process_row (GtkListItemFactory *factory,
GtkListItem *item)
{
GtkMountOperation *op = GTK_MOUNT_OPERATION (user_data);
GdkEvent *event;
GdkEventSequence *sequence;
GtkWidget *widget;
GtkWidget *box, *picture, *label;
ProcessData *data;
sequence = gtk_gesture_get_last_updated_sequence (gesture);
event = gtk_gesture_get_last_event (gesture, sequence);
widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture));
do_popup_menu_for_process_tree_view (widget, event, op);
data = gtk_list_item_get_item (item);
box = gtk_list_item_get_child (item);
picture = gtk_widget_get_first_child (box);
label = gtk_widget_get_next_sibling (picture);
gtk_picture_set_paintable (GTK_PICTURE (picture), GDK_PAINTABLE (data->texture));
gtk_label_set_markup (GTK_LABEL (label), data->name);
}
static GtkWidget *
@ -1507,20 +1479,15 @@ create_show_processes_dialog (GtkMountOperation *op,
char *primary;
int count, len = 0;
GtkWidget *label;
GtkWidget *tree_view;
GtkWidget *list_view;
GtkWidget *scrolled_window;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *content_area;
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
GtkListStore *list_store;
char *s;
gboolean use_header;
GtkGesture *gesture;
GtkEventController *controller;
GtkShortcutTrigger *trigger;
GtkShortcutAction *action;
GtkShortcut *shortcut;
GListStore *store;
GtkListItemFactory *factory;
GtkWidget *button;
priv = op->priv;
@ -1531,12 +1498,7 @@ create_show_processes_dialog (GtkMountOperation *op,
primary = g_strndup (message, primary - message);
}
g_object_get (gtk_settings_get_default (),
"gtk-dialogs-use-header", &use_header,
NULL);
dialog = g_object_new (GTK_TYPE_DIALOG,
"use-header-bar", use_header,
NULL);
dialog = gtk_dialog_new ();
if (priv->parent_window != NULL)
gtk_window_set_transient_for (GTK_WINDOW (dialog), priv->parent_window);
@ -1544,6 +1506,10 @@ create_show_processes_dialog (GtkMountOperation *op,
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_widget_set_margin_top (vbox, 12);
gtk_widget_set_margin_bottom (vbox, 12);
gtk_widget_set_margin_start (vbox, 12);
gtk_widget_set_margin_end (vbox, 12);
gtk_box_append (GTK_BOX (content_area), vbox);
if (secondary != NULL)
@ -1564,11 +1530,16 @@ create_show_processes_dialog (GtkMountOperation *op,
while (choices[len] != NULL)
len++;
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
for (count = len - 1; count >= 0; count--)
gtk_dialog_add_button (GTK_DIALOG (dialog), choices[count], count);
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (show_processes_button_clicked), op);
{
button = gtk_button_new_with_label (choices[count]);
g_object_set_data (G_OBJECT (button), "choice", GINT_TO_POINTER (count));
g_signal_connect (button, "clicked", G_CALLBACK (show_processes_button_clicked), op);
gtk_box_append (GTK_BOX (hbox), button);
}
gtk_widget_set_halign (hbox, GTK_ALIGN_END);
gtk_box_append (GTK_BOX (vbox), hbox);
priv->dialog = GTK_DIALOG (dialog);
g_object_notify (G_OBJECT (op), "is-showing");
@ -1576,67 +1547,38 @@ create_show_processes_dialog (GtkMountOperation *op,
if (priv->parent_window == NULL && priv->display)
gtk_window_set_display (GTK_WINDOW (dialog), priv->display);
tree_view = gtk_tree_view_new ();
gtk_widget_set_size_request (tree_view, 300, 120);
store = g_list_store_new (process_data_get_type ());
factory = gtk_signal_list_item_factory_new ();
column = gtk_tree_view_column_new ();
renderer = gtk_cell_renderer_pixbuf_new ();
gtk_tree_view_column_pack_start (column, renderer, FALSE);
gtk_tree_view_column_set_attributes (column, renderer,
"texture", 0,
NULL);
renderer = gtk_cell_renderer_text_new ();
g_object_set (renderer,
"ellipsize", PANGO_ELLIPSIZE_MIDDLE,
"ellipsize-set", TRUE,
NULL);
gtk_tree_view_column_pack_start (column, renderer, TRUE);
gtk_tree_view_column_set_attributes (column, renderer,
"markup", 1,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_view), FALSE);
g_signal_connect (factory, "setup", G_CALLBACK (setup_process_row), op);
g_signal_connect (factory, "bind", G_CALLBACK (bind_process_row), op);
list_view = gtk_list_view_new (GTK_SELECTION_MODEL (gtk_single_selection_new (G_LIST_MODEL (store))), factory);
gtk_widget_set_size_request (list_view, 300, 120);
scrolled_window = gtk_scrolled_window_new ();
gtk_widget_set_vexpand (scrolled_window, TRUE);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_propagate_natural_height (GTK_SCROLLED_WINDOW (scrolled_window), TRUE);
gtk_scrolled_window_set_has_frame (GTK_SCROLLED_WINDOW (scrolled_window), TRUE);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), tree_view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), list_view);
gtk_box_append (GTK_BOX (vbox), scrolled_window);
controller = gtk_shortcut_controller_new ();
trigger = gtk_alternative_trigger_new (gtk_keyval_trigger_new (GDK_KEY_F10, GDK_SHIFT_MASK),
gtk_keyval_trigger_new (GDK_KEY_Menu, 0));
action = gtk_callback_action_new (on_popup_menu_for_process_tree_view,
op,
NULL);
shortcut = gtk_shortcut_new_with_arguments (trigger, action, "s", "sv");
gtk_shortcut_controller_add_shortcut (GTK_SHORTCUT_CONTROLLER (controller), shortcut);
gtk_widget_add_controller (GTK_WIDGET (tree_view), controller);
button = gtk_button_new_with_mnemonic (_("_End Process"));
gtk_widget_set_halign (button, GTK_ALIGN_END);
g_signal_connect (button, "clicked", G_CALLBACK (on_end_process_activated), op);
gtk_box_append (GTK_BOX (vbox), button);
gesture = gtk_gesture_click_new ();
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY);
g_signal_connect (gesture, "pressed",
G_CALLBACK (click_cb), op);
gtk_widget_add_controller (tree_view, GTK_EVENT_CONTROLLER (gesture));
list_store = gtk_list_store_new (3,
GDK_TYPE_TEXTURE,
G_TYPE_STRING,
G_TYPE_INT);
gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), GTK_TREE_MODEL (list_store));
priv->process_list_store = list_store;
priv->process_tree_view = tree_view;
priv->process_list_store = store;
priv->process_list_view = list_view;
/* set pointers to NULL when dialog goes away */
g_object_add_weak_pointer (G_OBJECT (priv->process_list_store), (gpointer *) &priv->process_list_store);
g_object_add_weak_pointer (G_OBJECT (priv->process_tree_view), (gpointer *) &priv->process_tree_view);
g_object_add_weak_pointer (G_OBJECT (priv->process_list_view), (gpointer *) &priv->process_list_view);
g_object_unref (list_store);
g_object_ref (op);
return dialog;

View File

@ -4034,9 +4034,6 @@ gtk_notebook_insert_notebook_page (GtkNotebook *notebook,
g_signal_connect (controller, "enter", G_CALLBACK (gtk_notebook_tab_drop_enter), page);
g_signal_connect (controller, "leave", G_CALLBACK (gtk_notebook_tab_drop_leave), page);
gtk_widget_add_controller (page->tab_widget, controller);
gtk_accessible_update_property (GTK_ACCESSIBLE (page->tab_widget),
GTK_ACCESSIBLE_PROPERTY_LABEL, _("Tab"),
-1);
page->expand = FALSE;
page->fill = TRUE;
@ -4338,6 +4335,11 @@ gtk_notebook_update_labels (GtkNotebook *notebook)
text = page->tab_text;
else
text = string;
gtk_accessible_update_property (GTK_ACCESSIBLE (page->tab_widget),
GTK_ACCESSIBLE_PROPERTY_LABEL, text,
-1);
if (notebook->show_tabs)
{
if (page->default_tab)

View File

@ -253,14 +253,25 @@ gtk_password_entry_realize (GtkWidget *widget)
}
}
static void
gtk_password_entry_unrealize (GtkWidget *widget)
{
GtkPasswordEntry *entry = GTK_PASSWORD_ENTRY (widget);
if (entry->keyboard)
{
g_signal_handlers_disconnect_by_func (entry->keyboard, caps_lock_state_changed, entry);
entry->keyboard = NULL;
}
GTK_WIDGET_CLASS (gtk_password_entry_parent_class)->unrealize (widget);
}
static void
gtk_password_entry_dispose (GObject *object)
{
GtkPasswordEntry *entry = GTK_PASSWORD_ENTRY (object);
if (entry->keyboard)
g_signal_handlers_disconnect_by_func (entry->keyboard, caps_lock_state_changed, entry);
if (entry->entry)
gtk_editable_finish_delegate (GTK_EDITABLE (entry));
@ -451,6 +462,7 @@ gtk_password_entry_class_init (GtkPasswordEntryClass *klass)
object_class->set_property = gtk_password_entry_set_property;
widget_class->realize = gtk_password_entry_realize;
widget_class->unrealize = gtk_password_entry_unrealize;
widget_class->measure = gtk_password_entry_measure;
widget_class->size_allocate = gtk_password_entry_size_allocate;
widget_class->mnemonic_activate = gtk_password_entry_mnemonic_activate;

View File

@ -1239,6 +1239,10 @@ captured_scroll_cb (GtkEventControllerScroll *scroll,
gtk_scrolled_window_cancel_deceleration (scrolled_window);
if (!may_hscroll (scrolled_window) &&
!may_vscroll (scrolled_window))
return GDK_EVENT_PROPAGATE;
if (priv->smooth_scroll)
{
scrolled_window_scroll (scrolled_window, delta_x, delta_y, scroll);
@ -1429,6 +1433,10 @@ scroll_controller_scroll (GtkEventControllerScroll *scroll,
GtkScrolledWindowPrivate *priv =
gtk_scrolled_window_get_instance_private (scrolled_window);
if (!may_hscroll (scrolled_window) &&
!may_vscroll (scrolled_window))
return GDK_EVENT_PROPAGATE;
if (!priv->smooth_scroll)
scrolled_window_scroll (scrolled_window, delta_x, delta_y, scroll);

View File

@ -144,7 +144,11 @@ get_labels (guint key, GdkModifierType modifier, guint *n_mods)
if (modifier & GDK_HYPER_MASK)
labels[i++] = C_("keyboard label", "Hyper");
if (modifier & GDK_META_MASK)
#ifndef GDK_WINDOWING_MACOS
labels[i++] = C_("keyboard label", "Meta");
#else
labels[i++] = "";
#endif
*n_mods = i;

View File

@ -278,11 +278,6 @@ gtk_sidebar_row_set_property (GObject *object,
case PROP_SECTION_TYPE:
self->section_type = g_value_get_enum (value);
if (self->section_type == GTK_PLACES_SECTION_COMPUTER ||
self->section_type == GTK_PLACES_SECTION_OTHER_LOCATIONS)
gtk_label_set_ellipsize (GTK_LABEL (self->label_widget), PANGO_ELLIPSIZE_NONE);
else
gtk_label_set_ellipsize (GTK_LABEL (self->label_widget), PANGO_ELLIPSIZE_END);
break;
case PROP_PLACE_TYPE:

View File

@ -2753,8 +2753,6 @@ gtk_text_click_gesture_pressed (GtkGestureClick *gesture,
GdkDevice *source;
guint state;
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
sel_start = priv->selection_bound;
sel_end = priv->current_pos;
have_selection = sel_start != sel_end;
@ -2789,6 +2787,8 @@ gtk_text_click_gesture_pressed (GtkGestureClick *gesture,
gtk_text_selection_bubble_popup_unset (self);
else
gtk_text_selection_bubble_popup_set (self);
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
}
else if (extend_selection)
{
@ -2800,6 +2800,8 @@ gtk_text_click_gesture_pressed (GtkGestureClick *gesture,
/* all done, so skip the extend_to_left stuff later */
extend_selection = FALSE;
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
}
else
{
@ -2807,6 +2809,7 @@ gtk_text_click_gesture_pressed (GtkGestureClick *gesture,
priv->in_drag = TRUE;
priv->drag_start_x = x;
priv->drag_start_y = y;
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
}
}
else
@ -2815,7 +2818,13 @@ gtk_text_click_gesture_pressed (GtkGestureClick *gesture,
if (!extend_selection)
{
gtk_text_set_selection_bounds (self, tmp_pos, tmp_pos);
if (priv->current_pos != tmp_pos ||
priv->selection_bound != tmp_pos)
{
gtk_text_set_selection_bounds (self, tmp_pos, tmp_pos);
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
}
priv->handle_place_time = g_get_monotonic_time ();
}
else
@ -2825,6 +2834,7 @@ gtk_text_click_gesture_pressed (GtkGestureClick *gesture,
sel_start = sel_end = priv->current_pos;
gtk_text_set_positions (self, tmp_pos, tmp_pos);
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
}
}
@ -2833,11 +2843,13 @@ gtk_text_click_gesture_pressed (GtkGestureClick *gesture,
case 2:
priv->select_words = TRUE;
gtk_text_select_word (self);
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
break;
case 3:
priv->select_lines = TRUE;
gtk_text_select_line (self);
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
break;
default:
@ -3222,8 +3234,12 @@ gtk_text_focus_changed (GtkEventControllerFocus *controller,
if (gtk_event_controller_focus_is_focus (controller))
{
if (keyboard)
g_signal_connect (keyboard, "notify::direction",
G_CALLBACK (direction_changed), self);
{
/* Work around unexpected notify::direction emissions */
gdk_device_get_direction (keyboard);
g_signal_connect (keyboard, "notify::direction",
G_CALLBACK (direction_changed), self);
}
gtk_text_im_set_focus_in (self);
gtk_text_reset_blink_time (self);

View File

@ -5332,7 +5332,7 @@ gtk_text_buffer_get_run_attributes (GtkTextBuffer *buffer,
GdkRGBA *rgba;
char *value;
g_object_get (tag, "foreground", &rgba, NULL);
g_object_get (tag, "foreground-rgba", &rgba, NULL);
value = g_strdup_printf ("%u,%u,%u",
(guint) rgba->red * 65535,
(guint) rgba->green * 65535,

View File

@ -401,27 +401,6 @@ gtk_tooltip_window_new (void)
return g_object_new (GTK_TYPE_TOOLTIP_WINDOW, NULL);
}
static void
update_label_width (GtkLabel *label)
{
const char *text;
text = gtk_label_get_text (label);
if (strchr (text, '\n'))
{
gtk_label_set_wrap (label, FALSE);
}
else
{
int len;
len = g_utf8_strlen (text, -1);
gtk_label_set_max_width_chars (label, MIN (len, 50));
gtk_label_set_wrap (label, TRUE);
}
}
void
gtk_tooltip_window_set_label_markup (GtkTooltipWindow *window,
const char *markup)
@ -429,7 +408,6 @@ gtk_tooltip_window_set_label_markup (GtkTooltipWindow *window,
if (markup != NULL)
{
gtk_label_set_markup (GTK_LABEL (window->label), markup);
update_label_width (GTK_LABEL (window->label));
gtk_widget_show (window->label);
}
else
@ -445,7 +423,6 @@ gtk_tooltip_window_set_label_text (GtkTooltipWindow *window,
if (text != NULL)
{
gtk_label_set_text (GTK_LABEL (window->label), text);
update_label_width (GTK_LABEL (window->label));
gtk_widget_show (window->label);
}
else

View File

@ -266,6 +266,7 @@ gtk_tree_popover_init (GtkTreePopover *popover)
sw = gtk_scrolled_window_new ();
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_propagate_natural_width (GTK_SCROLLED_WINDOW (sw), TRUE);
gtk_scrolled_window_set_propagate_natural_height (GTK_SCROLLED_WINDOW (sw), TRUE);
gtk_popover_set_child (GTK_POPOVER (popover), sw);

View File

@ -4026,6 +4026,8 @@ gtk_widget_allocate (GtkWidget *widget,
priv->height = adjusted.height;
priv->baseline = baseline;
priv->alloc_needed_on_child = FALSE;
if (priv->layout_manager != NULL)
{
gtk_layout_manager_allocate (priv->layout_manager, widget,
@ -4053,7 +4055,6 @@ gtk_widget_allocate (GtkWidget *widget,
gtk_widget_ensure_resize (widget);
priv->alloc_needed = FALSE;
priv->alloc_needed_on_child = FALSE;
gtk_widget_update_paintables (widget);

View File

@ -184,6 +184,7 @@ typedef struct
GtkWidget *default_widget;
GtkWidget *focus_widget;
GtkWidget *move_focus_widget;
GtkWindow *transient_parent;
GtkWindowGeometryInfo *geometry_info;
GtkWindowGroup *group;
@ -2003,7 +2004,12 @@ gtk_window_root_set_focus (GtkRoot *root,
if (focus == priv->focus_widget)
{
priv->move_focus = FALSE;
if (priv->move_focus &&
focus && gtk_widget_is_visible (focus))
{
priv->move_focus = FALSE;
g_clear_object (&priv->move_focus_widget);
}
return;
}
@ -2023,7 +2029,12 @@ gtk_window_root_set_focus (GtkRoot *root,
g_clear_object (&old_focus);
priv->move_focus = FALSE;
if (priv->move_focus &&
focus && gtk_widget_is_visible (focus))
{
priv->move_focus = FALSE;
g_clear_object (&priv->move_focus_widget);
}
g_object_notify (G_OBJECT (self), "focus-widget");
}
@ -2547,6 +2558,7 @@ gtk_window_dispose (GObject *object)
g_list_free_full (priv->foci, (GDestroyNotify) gtk_pointer_focus_unref);
priv->foci = NULL;
g_clear_object (&priv->move_focus_widget);
gtk_window_set_focus (window, NULL);
gtk_window_set_default_widget (window, NULL);
@ -4675,7 +4687,28 @@ maybe_unset_focus_and_default (GtkWindow *window)
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
if (priv->move_focus)
gtk_widget_child_focus (GTK_WIDGET (window), GTK_DIR_TAB_FORWARD);
{
GtkWidget *parent;
parent = _gtk_widget_get_parent (priv->move_focus_widget);
while (parent)
{
if (_gtk_widget_get_visible (parent))
{
if (gtk_widget_grab_focus (parent))
break;
}
parent = _gtk_widget_get_parent (parent);
}
if (!parent)
gtk_widget_child_focus (GTK_WIDGET (window), GTK_DIR_TAB_FORWARD);
priv->move_focus = FALSE;
g_clear_object (&priv->move_focus_widget);
}
if (priv->unset_default)
gtk_window_set_default_widget (window, NULL);
@ -5134,7 +5167,10 @@ _gtk_window_unset_focus_and_default (GtkWindow *window,
child = priv->focus_widget;
if (child && (child == widget || gtk_widget_is_ancestor (child, widget)))
priv->move_focus = TRUE;
{
priv->move_focus_widget = g_object_ref (widget);
priv->move_focus = TRUE;
}
child = priv->default_widget;
if (child && (child == widget || gtk_widget_is_ancestor (child, widget)))

File diff suppressed because one or more lines are too long

View File

@ -3478,6 +3478,10 @@ calendar {
@extend %selected_items;
border-radius: 3px;
}
&:checked {
background-color: gtkalpha($selected_bg_color, 0.3);
}
}
> label.day-number.other-month {

View File

@ -14,7 +14,7 @@
<property name="shrink-start-child">0</property>
<property name="resize-start-child">0</property>
<property name="vexpand">1</property>
<child>
<property name="start-child">
<object class="GtkPlacesSidebar" id="places_sidebar">
<property name="show-other-locations">1</property>
<property name="show-trash">0</property>
@ -25,8 +25,8 @@
<signal name="show-error-message" handler="places_sidebar_show_error_message_cb" swapped="no"/>
<signal name="show-other-locations-with-flags" handler="places_sidebar_show_other_locations_with_flags_cb" swapped="no"/>
</object>
</child>
<child>
</property>
<property name="end-child">
<object class="GtkBox">
<property name="orientation">1</property>
<child>
@ -326,7 +326,7 @@
</object>
</child>
</object>
</child>
</property>
</object>
</child>
</object>

View File

@ -188,7 +188,7 @@
<property name="tooltip-text" translatable="yes">Preview Font</property>
<child>
<object class="GtkEventControllerScroll">
<property name="flags" translatable="yes">horizontal</property>
<property name="flags">horizontal</property>
<signal name="scroll" handler="resize_by_scroll_cb"/>
</object>
</child>
@ -217,7 +217,7 @@
<property name="round-digits">0</property>
<child>
<object class="GtkEventControllerScroll">
<property name="flags" translatable="yes">horizontal</property>
<property name="flags">horizontal</property>
<signal name="scroll" handler="resize_by_scroll_cb"/>
</object>
</child>

View File

@ -25,6 +25,7 @@
<object class="GtkLabel" id="label_widget">
<property name="hexpand">1</property>
<property name="xalign">0</property>
<property name="ellipsize">end</property>
<style>
<class name="sidebar-label"/>
</style>

View File

@ -13,7 +13,9 @@
</child>
<child>
<object class="GtkLabel" id="label">
<property name="hexpand">1</property>
<property name="wrap">1</property>
<property name="max-width-chars">50</property>
</object>
</child>
</object>

View File

@ -1,5 +1,5 @@
project('gtk', 'c',
version: '4.8.1',
version: '4.8.4',
default_options: [
'buildtype=debugoptimized',
'warning_level=1',

View File

@ -54,6 +54,7 @@ hu
hy
ia
id
ie
io
is
it

1192
po/ab.po

File diff suppressed because it is too large Load Diff

639
po/bg.po

File diff suppressed because it is too large Load Diff

765
po/ca.po

File diff suppressed because it is too large Load Diff

613
po/cs.po

File diff suppressed because it is too large Load Diff

587
po/de.po

File diff suppressed because it is too large Load Diff

587
po/es.po

File diff suppressed because it is too large Load Diff

637
po/eu.po

File diff suppressed because it is too large Load Diff

687
po/fa.po

File diff suppressed because it is too large Load Diff

4682
po/fur.po

File diff suppressed because it is too large Load Diff

View File

@ -5,8 +5,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+ 0\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtk/-/issues/\n"
"POT-Creation-Date: 2022-09-26 16:01+0000\n"
"PO-Revision-Date: 2022-09-26 21:29+0200\n"
"POT-Creation-Date: 2022-10-01 12:58+0000\n"
"PO-Revision-Date: 2022-10-02 16:02+0200\n"
"Last-Translator: gogo <trebelnik2@gmail.com>\n"
"Language-Team: Croatian <lokalizacija@linux.hr>\n"
"Language: hr\n"
@ -1035,7 +1035,7 @@ msgstr "Mozilla javna licenca 2.0"
#: gtk/gtkaboutdialog.c:937
msgid "Website"
msgstr "Web stranica"
msgstr "Web naslovnica"
#: gtk/gtkaboutdialog.c:973 gtk/ui/gtkapplication-quartz.ui:6
#, c-format
@ -1044,11 +1044,11 @@ msgstr "O %s"
#: gtk/gtkaboutdialog.c:2074
msgid "Created by"
msgstr "Stvorio"
msgstr "Stvorili"
#: gtk/gtkaboutdialog.c:2077
msgid "Documented by"
msgstr "Dokumentirao"
msgstr "Dokumentirali"
#: gtk/gtkaboutdialog.c:2087
msgid "Translated by"
@ -1056,7 +1056,7 @@ msgstr "Preveli"
#: gtk/gtkaboutdialog.c:2092
msgid "Design by"
msgstr "Dizajnirao"
msgstr "Dizajnirali"
#. Translators: this is the license preamble; the string at the end
#. * contains the name of the license as link text.
@ -2125,7 +2125,7 @@ msgstr "Datoteka s tim nazivom već postoji"
#: gtk/gtkmountoperation.c:608 gtk/gtkpagesetupunixdialog.c:283
#: gtk/gtkprintbackend.c:637 gtk/gtkprinteroptionwidget.c:721
#: gtk/gtkprintunixdialog.c:651 gtk/gtkprintunixdialog.c:807
#: gtk/gtkwindow.c:6113 gtk/inspector/css-editor.c:248
#: gtk/gtkwindow.c:6116 gtk/inspector/css-editor.c:248
#: gtk/inspector/recorder.c:1723 gtk/ui/gtkappchooserdialog.ui:45
#: gtk/ui/gtkassistant.ui:52 gtk/ui/gtkcolorchooserdialog.ui:33
#: gtk/ui/gtkfontchooserdialog.ui:24
@ -2216,7 +2216,7 @@ msgid "If you delete an item, it will be permanently lost."
msgstr "Ako obrišete stavku, biti će trajno izgubljena."
#: gtk/gtkfilechooserwidget.c:1211 gtk/gtkfilechooserwidget.c:1827
#: gtk/gtklabel.c:5652 gtk/gtktext.c:6051 gtk/gtktextview.c:8968
#: gtk/gtklabel.c:5652 gtk/gtktext.c:6049 gtk/gtktextview.c:8966
msgid "_Delete"
msgstr "_Obriši"
@ -2416,7 +2416,7 @@ msgstr "Ne možete pristupiti određenoj mapi."
msgid "Could not send the search request"
msgstr "Nemoguće slanje zahtjeva pretrage"
#: gtk/gtkfilechooserwidget.c:6876
#: gtk/gtkfilechooserwidget.c:6877
msgid "Accessed"
msgstr "Pristupljeno"
@ -2508,19 +2508,19 @@ msgstr "Varijacije znaka"
msgid "OpenGL context creation failed"
msgstr "Neuspjelo stvaranje OpenGL sadržaja"
#: gtk/gtklabel.c:5649 gtk/gtktext.c:6039 gtk/gtktextview.c:8956
#: gtk/gtklabel.c:5649 gtk/gtktext.c:6037 gtk/gtktextview.c:8954
msgid "Cu_t"
msgstr "Iz_reži"
#: gtk/gtklabel.c:5650 gtk/gtktext.c:6043 gtk/gtktextview.c:8960
#: gtk/gtklabel.c:5650 gtk/gtktext.c:6041 gtk/gtktextview.c:8958
msgid "_Copy"
msgstr "_Kopiraj"
#: gtk/gtklabel.c:5651 gtk/gtktext.c:6047 gtk/gtktextview.c:8964
#: gtk/gtklabel.c:5651 gtk/gtktext.c:6045 gtk/gtktextview.c:8962
msgid "_Paste"
msgstr "_Zalijepi"
#: gtk/gtklabel.c:5657 gtk/gtktext.c:6060 gtk/gtktextview.c:8989
#: gtk/gtklabel.c:5657 gtk/gtktext.c:6058 gtk/gtktextview.c:8987
msgid "Select _All"
msgstr "Odaberi _sve"
@ -2630,7 +2630,7 @@ msgid "%d:%02d"
msgstr "%d:%02d"
#: gtk/gtkmessagedialog.c:158 gtk/gtkmessagedialog.c:176
#: gtk/gtkprintbackend.c:638 gtk/gtkwindow.c:6114
#: gtk/gtkprintbackend.c:638 gtk/gtkwindow.c:6117
msgid "_OK"
msgstr "_U redu"
@ -3507,15 +3507,15 @@ msgctxt "accessibility"
msgid "Sidebar"
msgstr "Bočna traka"
#: gtk/gtktext.c:6065 gtk/gtktextview.c:8994
#: gtk/gtktext.c:6063 gtk/gtktextview.c:8992
msgid "Insert _Emoji"
msgstr "Umetni _emotikoin"
#: gtk/gtktextview.c:8976
#: gtk/gtktextview.c:8974
msgid "_Undo"
msgstr "_Vrati"
#: gtk/gtktextview.c:8980
#: gtk/gtktextview.c:8978
msgid "_Redo"
msgstr "_Ponovi"
@ -3542,12 +3542,12 @@ msgctxt "volume percentage"
msgid "%d%%"
msgstr "%d%%"
#: gtk/gtkwindow.c:6101
#: gtk/gtkwindow.c:6104
#, c-format
msgid "Do you want to use GTK Inspector?"
msgstr "Želite li koristiti GTK Inspektora?"
#: gtk/gtkwindow.c:6103
#: gtk/gtkwindow.c:6106
#, c-format
msgid ""
"GTK Inspector is an interactive debugger that lets you explore and modify "
@ -3558,7 +3558,7 @@ msgstr ""
"otkrivanje i promjenu unutrašnjosti bilo koje GTK aplikacije. Njegovo "
"korištenje može uzrokovati rušenje ili prekid u radu aplikacije."
#: gtk/gtkwindow.c:6108
#: gtk/gtkwindow.c:6111
msgid "Dont show this message again"
msgstr "Ne prikazuj više ovu poruku"
@ -6973,15 +6973,15 @@ msgstr "Datoteka"
msgid "_Output format"
msgstr "_Izlazni format"
#: modules/printbackends/gtkprintbackendlpr.c:371
#: modules/printbackends/gtkprintbackendlpr.c:372
msgid "Print to LPR"
msgstr "Ispiši do LPR"
#: modules/printbackends/gtkprintbackendlpr.c:400
#: modules/printbackends/gtkprintbackendlpr.c:401
msgid "Pages Per Sheet"
msgstr "Stranica po listu"
#: modules/printbackends/gtkprintbackendlpr.c:406
#: modules/printbackends/gtkprintbackendlpr.c:407
msgid "Command Line"
msgstr "Naredbeni redak"

690
po/hu.po

File diff suppressed because it is too large Load Diff

637
po/id.po

File diff suppressed because it is too large Load Diff

7813
po/ie.po Normal file

File diff suppressed because it is too large Load Diff

643
po/ka.po

File diff suppressed because it is too large Load Diff

641
po/nl.po

File diff suppressed because it is too large Load Diff

591
po/ru.po

File diff suppressed because it is too large Load Diff

808
po/sr.po

File diff suppressed because it is too large Load Diff

601
po/tr.po

File diff suppressed because it is too large Load Diff

View File

@ -2,5 +2,5 @@
directory=glib
url=https://gitlab.gnome.org/GNOME/glib.git
push-url=ssh://git@gitlab.gnome.org:GNOME/glib.git
revision=main
revision=glib-2-74
depth=1

View File

@ -2,5 +2,5 @@
directory=harfbuzz
url=https://github.com/harfbuzz/harfbuzz.git
push-url=git@github.com:harfbuzz/harfbuzz.git
revision=main
revision=4.0.0
depth=1

View File

@ -20,6 +20,7 @@
#include <gtk/gtk.h>
static gboolean ask_question = FALSE;
static gboolean show_processes = FALSE;
static gboolean anonymous = FALSE;
static gboolean dont_ask_username = FALSE;
static gboolean dont_ask_domain = FALSE;
@ -100,6 +101,7 @@ main (int argc, char *argv[])
GError *error = NULL;
GOptionEntry options[] = {
{ "ask-question", 'q', 0, G_OPTION_ARG_NONE, &ask_question, "Ask a question not a password.", NULL },
{ "show-processes", 0, 0, G_OPTION_ARG_NONE, &show_processes, "Show (pretend) processes.", NULL },
{ "right-to-left", 'r', 0, G_OPTION_ARG_NONE, &force_rtl, "Force right-to-left layout.", NULL },
{ "anonymous", 'a', 0, G_OPTION_ARG_NONE, &anonymous, "Anonymous login allowed.", NULL },
{ "no-username", 'u', 0, G_OPTION_ARG_NONE, &dont_ask_username, "Don't ask for the username.", NULL },
@ -137,6 +139,26 @@ main (int argc, char *argv[])
g_signal_emit_by_name (op, "ask_question", "Foo\nbar", choices);
}
else if (show_processes)
{
static const char *choices[] = {
"Yes", "No", "Sauerkraut", NULL
};
GArray *pids;
GPid pid;
pids = g_array_new (TRUE, FALSE, sizeof (GPid));
pid = (GPid)1000;
g_array_append_val (pids, pid);
pid = (GPid)2000;
g_array_append_val (pids, pid);
pid = (GPid)3000;
g_array_append_val (pids, pid);
g_signal_emit_by_name (op, "show-processes", "Foo\nbar", pids, choices);
g_array_unref (pids);
}
else
{
GAskPasswordFlags flags;

View File

@ -14,7 +14,10 @@ if hasattr(os, 'add_dll_directory'):
if path != '' and os.path.isdir(path):
os.add_dll_directory(path)
import gi
try:
import gi
except ImportError:
sys.exit(77) # skip this test, gi module is not available
gi.require_version('Gtk', '4.0')

View File

@ -1,5 +1,3 @@
py = import('python').find_installation('python3', modules: ['gi'])
env = environment()
env.prepend('GI_TYPELIB_PATH',
project_build_root / 'gtk',