Compare commits

...

97 Commits

Author SHA1 Message Date
Matthias Clasen 12d8f5d85b build: Don't declare harfbuzz_dep twice 2023-01-06 12:27:08 -05:00
Matthias Clasen e10f206e64 build: Use a stable harfbuzz
We don't need the latest harfbuzz.
Stick to 4.0 for now.
2023-01-06 12:07:29 -05:00
Nart Tlisha 1e27563425 Update Abkhazian translation 2023-01-05 12:23:44 +00: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
62 changed files with 19552 additions and 7857 deletions
+26 -6
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
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
========================================
+2 -1
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);
+18 -2
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");
+38 -2
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
+8 -2
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__ */
+2 -2
View File
@@ -2800,10 +2800,10 @@ 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);
+12 -2
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;
}
/**
+12 -8
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)
+2 -1
View File
@@ -431,7 +431,8 @@ fill_key_event (GdkMacosDisplay *display,
state,
is_modifier,
&translated,
&no_lock);
&no_lock,
NULL);
}
static GdkEvent *
+2 -1
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);
}
+9 -3
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,8 @@ pointer_handle_button (void *data,
gdk_wayland_seat_set_frame_event (seat, event);
modifier = 1 << (8 + gdk_button - 1);
modifier = (GDK_BUTTON1_MASK << (button - BUTTON_BASE - 1)) & ALL_BUTTONS_MASK;
if (state)
seat->pointer_info.button_modifiers |= modifier;
else
@@ -2205,7 +2210,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 +5328,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);
}
+1 -1
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;
+2 -1
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);
+15 -6
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);
+82 -103
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) &&
-8
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;
+2 -1
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);
+6
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;
+1 -1
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;
+2
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);
+11 -3
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;
}
+4
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)
+2 -1
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;
}
+13 -1
View File
@@ -192,11 +192,23 @@ 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;
GtkWidget *widget = gtk_event_controller_get_widget (controller);
if (!gtk_event_controller_focus_contains_focus (GTK_EVENT_CONTROLLER_FOCUS (controller)))
gtk_editable_label_stop_editing (GTK_EDITABLE_LABEL (widget), TRUE);
return FALSE;
}
static void
gtk_editable_label_focus_out (GtkEventController *controller,
GtkEditableLabel *self)
{
gtk_editable_label_stop_editing (self, TRUE);
g_timeout_add (100, stop_editing_soon, controller);
}
static void
+12 -44
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;
+2 -1
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);
+6 -117
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;
}
+2 -1
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);
+91 -53
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
-18
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);
+2 -1
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
+28 -22
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
+154 -212
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;
+21 -5
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);
+1
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);
+40 -4
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
+1 -4
View File
@@ -1,5 +1,5 @@
project('gtk', 'c',
version: '4.8.1',
version: '4.8.4',
default_options: [
'buildtype=debugoptimized',
'warning_level=1',
@@ -433,9 +433,6 @@ jpeg_dep = dependency(is_msvc_like ? 'jpeg' : 'libjpeg',
epoxy_dep = dependency('epoxy', version: epoxy_req,
fallback: ['libepoxy', 'libepoxy_dep'])
harfbuzz_dep = dependency('harfbuzz', version: '>= 2.1.0', required: false,
fallback: ['harfbuzz', 'libharfbuzz_dep'],
default_options: ['coretext=enabled'])
xkbdep = dependency('xkbcommon', version: xkbcommon_req, required: wayland_enabled)
graphene_dep = dependency('graphene-gobject-1.0', version: graphene_req,
fallback: ['graphene', 'graphene_dep'],
+1
View File
@@ -54,6 +54,7 @@ hu
hy
ia
id
ie
io
is
it
+617 -575
View File
File diff suppressed because it is too large Load Diff
+321 -318
View File
File diff suppressed because it is too large Load Diff
+397 -368
View File
File diff suppressed because it is too large Load Diff
+295 -292
View File
File diff suppressed because it is too large Load Diff
+295 -292
View File
File diff suppressed because it is too large Load Diff
+320 -317
View File
File diff suppressed because it is too large Load Diff
+345 -342
View File
File diff suppressed because it is too large Load Diff
+2312 -2370
View File
File diff suppressed because it is too large Load Diff
+23 -23
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"
+291 -399
View File
File diff suppressed because it is too large Load Diff
+320 -317
View File
File diff suppressed because it is too large Load Diff
+7813
View File
File diff suppressed because it is too large Load Diff
+324 -319
View File
File diff suppressed because it is too large Load Diff
+322 -319
View File
File diff suppressed because it is too large Load Diff
+297 -294
View File
File diff suppressed because it is too large Load Diff
+412 -396
View File
File diff suppressed because it is too large Load Diff
+276 -273
View File
File diff suppressed because it is too large Load Diff
+1 -1
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
+1 -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
+22
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 = 1000;
g_array_append_val (pids, pid);
pid = 2000;
g_array_append_val (pids, pid);
pid = 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;
+4 -1
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')
-2
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',