Compare commits

...

402 Commits

Author SHA1 Message Date
Nelson Benítez León bd206f3b7a Improve window size for long text tooltips
When a tooltip reaches the hardcoded limit of 50
chars it will wrap to a new line, but keeps the
window's width same as if it were just one line.

From GtkLabel docs:
"For wrapping labels, width-chars is used as the
minimum width, if specified, and max-width-chars
is used as the natural width."

So we detect for this case and set label's width-chars
property, so we set the minimum size to a lesser value.

Fixes #5521
2023-01-22 16:34:07 +00:00
Jordi Mas 8f2ad8f154 Update Catalan translation 2023-01-21 16:58:51 +01:00
Ekaterine Papava 2f894bb4ef Update Georgian translation 2023-01-20 16:04:31 +00:00
Matthias Clasen 2509fe0d17 Merge branch 'matthiasc/for-main' into 'main'
Cosmetics

See merge request GNOME/gtk!5434
2023-01-17 21:37:39 +00:00
Matthias Clasen 83a5611ce8 settings: Modernize the code
Drop some things that are no longer relevant,
and make this code look like modern GObject code.
2023-01-17 15:19:50 -05:00
Matthias Clasen af088d5e11 settings: Drop object_list
This code came from a time when we were installing
additional settings at runtime. We no longer do that,
so this code is unnecessary.
2023-01-17 08:30:37 -05:00
Matthias Clasen a6e1c5c96a modules: Cosmetics
Use g_strv_length, instead of open-coding it.
2023-01-17 07:47:28 -05:00
Matthias Clasen 3c8c54ed15 stylecascade: Avoid some allocations 2023-01-17 07:39:51 -05:00
Matthias Clasen c4d3d72c57 Merge branch 'fix-hidpi-pictures' into 'main'
picture: Fix hi-dpi image handling

See merge request GNOME/gtk!5430
2023-01-16 14:32:01 +00:00
Matthias Clasen cd79159420 picture: Fix hi-dpi image handling
The idea behind this code was to let scalable
images (i.e. mainly SVGs) provide twice as much
detail when the scale is 2. But we were also
using a scaler for pngs, causing them to be too
small on a hidpi screen. Fix that.

Note that there are cases where you want scaling
for pngs (when you display them scaled down, so
the image has 'hidden' detail). But we are not
attempting to handle that situation automatically.
2023-01-16 08:48:37 -05:00
Emin Tufan Çetin 071c6c60c0 Update Turkish translation 2023-01-15 22:47:27 +00:00
Matthias Clasen fc24f401b7 Merge branch 'matthiasc/for-main' into 'main'
Use GtkUriLauncher where appropriate

See merge request GNOME/gtk!5432
2023-01-15 18:48:22 +00:00
Matthias Clasen 6c96e51b07 Use GtkUriLauncher where appropriate
GtkLabel, GtkLinkButton and GtkAboutDialog
all have a uri, not a file, so it makes more
sense to use a GtkUriLauncher.
2023-01-15 13:26:53 -05:00
Matthias Clasen e703163bc4 Merge branch 'uri-launcher-demo' into 'main'
urilauncher: Fix finish function mismatch

See merge request GNOME/gtk!5431
2023-01-15 17:47:18 +00:00
Matthias Clasen ad549cbded gtk-demo: Add a uri launcher demo 2023-01-15 11:58:43 -05:00
Matthias Clasen 673beef210 urilauncher: Fix finish function mismatch
We need to call the finish function that
matches the async function.
2023-01-15 11:58:09 -05:00
Matthias Clasen 55baa1f2e1 Merge branch 'docs-escape-xml-tag' into 'main'
Escape GtkBuilder XML tag in comment with backtick

Closes #5312

See merge request GNOME/gtk!5429
2023-01-15 15:12:28 +00:00
sunce b13f05537b Escape GtkBuilder XML tag in comment with backtick
Escape XML tags in gi-docgen oriented comment e.g. from <child> to
`<child>`, so that they don't become HTML tag on the final webpage.
This fix includes everything from commit ff46ea64 and #5312.

Fixes #5312
2023-01-15 16:55:18 +08:00
Matthias Clasen 0834dac6ee Merge branch 'matthiasc/for-main' into 'main'
widgetfactory: Load textures in threads

See merge request GNOME/gtk!5428
2023-01-15 04:12:47 +00:00
Matthias Clasen 3c31f72219 texture: Update docs
Document that we support TIFF as well.
2023-01-14 22:48:57 -05:00
Matthias Clasen a0f63160d6 widgetfactory: Load textures in threads
It is useful to show how this is done, even
though the images here are not terribly large.
2023-01-14 22:38:20 -05:00
Matthias Clasen c99d85954a Merge branch 'nielsdg/gtkwidgetactionactivatefunc-nullable-variant' into 'main'
Add missing nullable to GtkWidgetActionActivateFunc

See merge request GNOME/gtk!5424
2023-01-15 00:46:11 +00:00
Matthias Clasen 33f31d06f9 Merge branch 'uri-launcher' into 'main'
filelauncher: Plug a memory leak

See merge request GNOME/gtk!5425
2023-01-14 22:59:01 +00:00
Matthias Clasen bf4b40f17e docs: Update deprecations for gtk_show_uri
We have a better replacement now.
2023-01-14 17:39:28 -05:00
Matthias Clasen 7aba9e3295 urilauncher: Add cross-references to the docs 2023-01-14 17:39:28 -05:00
Matthias Clasen 3080cb7acd Add GtkUriLauncher 2023-01-14 17:39:28 -05:00
Matthias Clasen 4b404f0dea Add g_openuri_portal_open_uri_async
This avoids a roundtrip through GFile and
thus works with random uri schemes.
2023-01-14 14:32:51 -05:00
Matthias Clasen 0c1c0524c7 openuri: Some reshuffling
This is in preparation of adding a method
that takes a uri instead of a GFile.
2023-01-14 14:32:51 -05:00
Matthias Clasen b58ef290dc filelauncher: Plug a memory leak
Oops
2023-01-14 14:32:51 -05:00
Niels De Graef 1387fba7f8 Add missing nullable to GtkWidgetActionActivateFunc
The `GVariant` that is passed on to the `GtkWidgetActionActivateFunc`
can be `NULL` in case the parameter type is also `NULL`, so mark it
nullable.
2023-01-14 15:30:15 +01:00
Matthias Clasen 34b9ec5be2 Merge branch 'matthiasc/for-main' into 'main'
Fix a compiler warning

See merge request GNOME/gtk!5423
2023-01-14 05:30:10 +00:00
Matthias Clasen cefdfbd894 icontheme: Streamline the suffix handling code 2023-01-14 00:14:43 -05:00
Matthias Clasen 3676ddbdff icontheme: Avoid some allocations
When loading icon themes, we can reuse memory
instead of allocating and freeing in a loop.
2023-01-14 00:14:43 -05:00
Matthias Clasen 7c1a0e0c15 icontheme: Keep a single string set
Instead of keeping a GtkStringSet per IconTheme,
just make one for the whole GtkIconTheme.

This avoids loops of the themes in some places, and
due to the overlap in icon names between the themes,
it reduces the amount of memory we use for the icon
names with Adwaita+hicolor from 5+4 chunks to 6 chunks.
2023-01-14 00:14:43 -05:00
Matthias Clasen 19bb043a85 testsuite: Fix various compiler warnings
These are mostly dead stores that clang
isn't happy with.
2023-01-14 00:14:43 -05:00
Matthias Clasen fecc80b59c Fix a compiler warning
Clang things that timings can be NULL here,
and I think it might be right.
2023-01-14 00:14:41 -05:00
Matthias Clasen 1648dc36f8 Merge branch 'wip/corey/fix-docs' into 'main'
docs: Fix dependency names

See merge request GNOME/gtk!5422
2023-01-14 04:23:34 +00:00
Matthias Clasen a27a2cbf40 Merge branch 'matthiasc/for-main' into 'main'
Silence a compiler warning

See merge request GNOME/gtk!5421
2023-01-14 00:18:50 +00:00
Corey Berla e418656a04 docs: Fix dependency names
When gi-docgen added the "related" key, it also began checking
that the dependencies were actually dependencies otherwise they aren't
listed as dependencies.  The capitalization needs to match the
namespace.
2023-01-13 14:24:33 -08:00
Matthias Clasen d4ec1afe44 Merge branch 'fix-spinner-stop' into 'main'
gtkcssanimatedstyle: Fix return of new_advance()

Closes #4426

See merge request GNOME/gtk!5420
2023-01-13 20:14:25 +00:00
Matteo Percivaldi 374d97008b gtkcssanimatedstyle: Fix return of new_advance()
This was causing animation and transition to stop randomly and reset
their state to initial state.

This issue has existed since commit
7b68bdb831.

Closes #4426
2023-01-13 18:08:56 +01:00
Matthias Clasen fecc923c2c Silence compiler warnings
Clang complains that these are dead stores.
They are, indeed.
2023-01-13 12:07:40 -05:00
Matthias Clasen 703ed608c0 Fix a compiler warning
Clang things that load_error might be NULL here.
It may be right.
2023-01-13 12:07:40 -05:00
Matthias Clasen 99f07c7c0a Fix a compiler warning
Clang things that timings can be NULL here,
and I think it might be right.
2023-01-13 12:07:40 -05:00
Matthias Clasen 51b4d70b8f gridview: Add a few assertions
Just to help static analysis out.

self->n_columns can't ever be 0, since
we clamp it between min_columns and
max_columns, with min_columns always
being at least one.
2023-01-13 12:07:40 -05:00
Matthias Clasen 746d12fc43 Silence a compiler warning
Clang was complaining that we never use the
value stored in mime_type. Just don't store it,
we are only interested in the side-effect
(interning the string).
2023-01-13 12:07:40 -05:00
Matthias Clasen 96ce9e10b8 Merge branch 'faster-ci' into 'main'
Add a build-testsuite option

See merge request GNOME/gtk!5419
2023-01-13 12:57:15 +00:00
Matthias Clasen 3090795351 ci: Try to speed up builds a bit
Don't build demos and tests, and only build
the testsuite where we want to run it.
2023-01-13 07:26:41 -05:00
Matthias Clasen 815b54f3df Update the build documentation 2023-01-13 07:15:15 -05:00
Matthias Clasen 9ad27e4371 Add a build-testsuite option
This will let us run the testsuite in ci without
having to build all the manual tests.
2023-01-13 07:14:33 -05:00
Matthias Clasen a6e1804474 Merge branch 'macos-werror' into 'main'
CI: turn on -Werror for MacOS build

See merge request GNOME/gtk!5418
2023-01-13 03:08:36 +00:00
Benjamin Otte 7ae549e253 CI: turn on -Werror for MacOS build
The build is error-free and we want to keep it that way.

We'd also like to make Timm do real work instead of having to fix clang
warnings all the time and this build is a clang build.
2023-01-12 20:12:37 -05:00
Matthias Clasen 434d8ef0ea Merge branch 'wip/chergert/fix-macos-warnings' into 'main'
Fixes a few compilation warnings on macOS

See merge request GNOME/gtk!5415
2023-01-13 00:10:48 +00:00
Matthias Clasen 31a6d73635 Merge branch 'ebassi/pin-gi' into 'main'
Add gobject-introspection as a subproject

See merge request GNOME/gtk!5414
2023-01-12 23:35:23 +00:00
Christian Hergert 958ecf2855 gdk/macos: fix warning about _coreCursorType 2023-01-12 13:22:47 -08:00
Christian Hergert fb12ad807a gsk/gl: fix warning when join_sources() is unused 2023-01-12 13:22:25 -08:00
Christian Hergert 965c52d369 gdk: fix warning when !HAVE_EGL 2023-01-12 13:22:02 -08:00
Emmanuele Bassi 474872563f Add gobject-introspection as a subproject
We pin GLib, so we must also pin g-i to the same version, otherwise
we'll get weird mismatches during development.
2023-01-12 17:56:37 +00:00
Matthias Clasen b92e52bf0e Merge branch 'matthiasc/for-main' into 'main'
css: Avoid some allocations

See merge request GNOME/gtk!5413
2023-01-12 15:20:49 +00:00
Matthias Clasen d226dc3812 iconcache: Be a bit less wasteful 2023-01-12 00:36:18 -05:00
Matthias Clasen 46e0fde606 css: Avoid more allocations for tokens
Make short string tokens static.
2023-01-12 00:12:09 -05:00
Matthias Clasen 1e7f525e0e css: Avoid some allocations
Avoid duplicating the function name just
for an error message.
2023-01-12 00:12:09 -05:00
Matthias Clasen d43e0fb9a7 css: Avoid allocation for tokens
All valid dimensions are short, so store
the dimension inside the token.
2023-01-12 00:11:46 -05:00
Matthias Clasen 6fb6f47fc8 css: Avoid some allocations
Reuse the name_buffer for reading strings.
2023-01-12 00:11:11 -05:00
Matthias Clasen 0f7d8e04d8 css: Some inlining 2023-01-12 00:11:10 -05:00
Matthias Clasen c9fca559dc Cosmetics 2023-01-12 00:11:10 -05:00
Matthias Clasen b9d1b5d6a3 icontheme: Bit a bit less wasteful 2023-01-12 00:11:10 -05:00
Emin Tufan Çetin 5f75ba46a5 Update Turkish translation 2023-01-11 07:01:44 +00:00
Emin Tufan Çetin 2507301983 Update Turkish translation 2023-01-11 05:41:40 +00:00
Matthias Clasen 41aeff331d texthistory: Avoid g_autofree
msvc does not like it, unfortunately.
2023-01-10 22:20:57 -05:00
Matthias Clasen 3aab48ec16 Merge branch 'wip/chergert/fix-5506' into 'main'
istring: fix istring_prepend() on malloc transition

Closes #5506

See merge request GNOME/gtk!5411
2023-01-11 02:39:32 +00:00
Christian Hergert ad0348b85e texthistory: add debugging helpers to print undo stack
This is helpful to have when tracking down issues like #5506.
2023-01-10 13:36:16 -08:00
Christian Hergert 6a134551b9 istring: fix istring_prepend() on malloc transition
When transitioning from internal to malloc, the strings were placed in
the wrong order to g_strconcat(). This fixes an issue with undo where
if you hit the boundary in just the right way, your undo stack will do
unexpected things.

Fixes #5506
2023-01-10 13:32:38 -08:00
Matthias Clasen 0e1ae6ad11 Merge branch 'matthiasc/for-main' into 'main'
Add some more text undo tests

See merge request GNOME/gtk!5410
2023-01-10 19:05:13 +00:00
Aleksandr Melman 5baf4b4b2e Update Russian translation 2023-01-10 12:57:03 +00:00
Matthias Clasen 63560061e8 Add some more text undo tests
Unsuccessfully trying to reproduce #5506.
2023-01-10 07:34:55 -05:00
Matthias Clasen be721f5797 Merge branch 'matthiasc/for-main' into 'main'
Deprecate gdk_display_put_event

See merge request GNOME/gtk!5409
2023-01-09 21:15:08 +00:00
Matthias Clasen 0073bb79a7 Deprecate gdk_display_put_event
The documentation already tells you not to
use this function.

Ifdef the remaining users in the X11 backend.
2023-01-09 15:46:25 -05:00
Matthias Clasen f59b506674 Merge branch 'macos-stable-dnd' into 'main'
macos: Drag and drop should not freeze applications

See merge request GNOME/gtk!5291
2023-01-09 11:52:50 +00:00
Matthias Clasen 88b4404296 Merge branch 'wip/corey/popover-accel' into 'main'
gtkmodelbutton: Ensure that accel label is always aligned to end

Closes #5504

See merge request GNOME/gtk!5407
2023-01-09 10:58:14 +00:00
Corey Berla e20bc7723a gtkmodelbutton: Ensure that accel label is always aligned to end
When the model button just has a text label and accel text,
the button fills and the accel label is implicitly aigned to end.
When there's also a icon, even though it's not shown (because
icons are only shown if there's no text), the button doesn't fill
and the accel ends up not aligned (assuming one of the other buttons
is longer). Ensure that the accel label is aligned to the end.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5504
2023-01-08 22:32:22 -08:00
Emmanuele Bassi 7edf8841fb Merge branch 'a11y_check_null_path' into 'main'
a11y: Avoid crashing if GtkAtSpiContext::path is NULL

See merge request GNOME/gtk!5405
2023-01-09 00:14:21 +00:00
Emmanuele Bassi 6b5b7eab04 Merge branch 'doc-improvements' into 'main'
Two docs improvements

See merge request GNOME/gtk!5406
2023-01-08 22:16:49 +00:00
Marco Melorio c775262e9d docs: Improve gtk_window_present description
Move most of the documentation from gtk_window_present_with_time and
also reword it a bit to make it more understandable.
2023-01-08 22:41:19 +01:00
Marco Melorio 553fde9761 docs: Don't mention deprecated API in gtk_widget_set_visible
That statement is true, but since that API is deprecated, it doesn't
need to be there anymore to avoid confusing people.
2023-01-08 21:49:28 +01:00
Barnabás Pőcze f2593dec4b a11y: Use fallback logic when GApplication has no DBus object path
Use the fallback logic to generate the base path for the GtkAtSpiRoot
if the GApplication has no DBus object path to guarantee that
the base path will not stay NULL.
2023-01-08 19:58:54 +01:00
Barnabás Pőcze ab5a6ed0f1 a11y: Check if path is NULL when removing from cache
`gtk_at_spi_cache_add_context()` checks if the GtkAtSpiContext's path
is NULL before inserting the context object into the hash table.
Do the same in `gtk_at_spi_cache_remove_context()` to avoid a NULL
pointer dereference in `g_str_hash()` during the hash table lookup
if a context with NULL path is removed. That can happen when the
GtkAtSpiRoot::base_path is NULL, which, in turn, can happen if
`g_application_get_dbus_object_path()` returns NULL.

  ==394047==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fd1966f8b84 bp 0x7fff11e3ded0 sp 0x7fff11e3de58 T0)
  ==394047==The signal is caused by a READ memory access.
  ==394047==Hint: address points to the zero page.
      #0 0x7fd1966f8b84 in g_str_hash (/usr/lib/libglib-2.0.so.0+0x37b84)
      #1 0x7fd1966f9c09 in g_hash_table_contains (/usr/lib/libglib-2.0.so.0+0x38c09)
      #2 0x7fd196062c10 in gtk_at_spi_cache_remove_context ../gtk/a11y/gtkatspicache.c:447
      #3 0x7fd19606e0a9 in gtk_at_spi_root_unregister ../gtk/a11y/gtkatspiroot.c:653
      #4 0x7fd196067f58 in gtk_at_spi_context_unrealize ../gtk/a11y/gtkatspicontext.c:1559
      #5 0x7fd195ced97f in gtk_at_context_unrealize ../gtk/gtkatcontext.c:668
      #6 0x7fd195f5576e in gtk_widget_unroot_at_context ../gtk/gtkwidget.c:2399
      #7 0x7fd195f55bd2 in gtk_widget_unroot ../gtk/gtkwidget.c:2499
      ...
2023-01-08 19:56:49 +01:00
Matthias Clasen dd3cdc52f5 Fix code style 2023-01-08 14:41:11 +00:00
Matthias Clasen 5a3156a8b7 gdk: Update docs
Update the docs for gdk_display_get_monitor_at_surface.
2023-01-07 21:35:29 -05:00
Matthias Clasen a4c2f19155 Merge branch 'gdk-display-get-monitor-is-nullable' into 'main'
gdkdisplay: Document get_monitor_at_surface can return NULL

Closes #5075

See merge request GNOME/gtk!4917
2023-01-07 20:39:04 +00:00
Matthias Clasen be8fb1e9b8 Merge branch 'more-filesystemmodel-cleanups' into 'main'
filesystemmodel: Crop tree model cruft

See merge request GNOME/gtk!5402
2023-01-07 18:42:14 +00:00
Matthias Clasen 52c97dbf67 Merge branch 'win-file-ext' into 'main'
filechoosernativewin32: Set default extension

See merge request GNOME/gtk!5266
2023-01-07 18:14:37 +00:00
robxnano 57ebf26f15 filechoosernativewin32: Set default extension 2023-01-07 18:14:36 +00:00
Matthias Clasen 32247bc50e filesystemmodel: Drop tree model cruft
We no longer need the placeholder item for the
editable, so drop it.
2023-01-07 12:22:25 -05:00
Matthias Clasen ad940bc892 filesystemmodel: Rename private header 2023-01-07 12:01:15 -05:00
Matthias Clasen 7d34e7e0f7 Merge branch 'filesystemmodel-cleanups' into 'main'
filesystemmodel: Cleanup unused defines

See merge request GNOME/gtk!5401
2023-01-07 14:36:20 +00:00
Georges Basile Stavracas Neto b2f43076bd gtkfilesystemmodel: Use g_clear_* helpers
Saves some code.
2023-01-07 09:17:37 -05:00
Georges Basile Stavracas Neto 202e889577 filesystemmodel: Use G_DECLARE_FINAL_TYPE()
Clean up boilerplate. It's a private object anyway.
2023-01-07 09:17:37 -05:00
Georges Basile Stavracas Neto a8690c84ab filesystemmodel: Cosmetics
Adjust code style, and shuffle some functions around. Remove
unhelpful doc comments.
2023-01-07 09:17:15 -05:00
Matthias Clasen 35244f4b59 filesystemmodel: Use g_set_object 2023-01-07 09:12:44 -05:00
Georges Basile Stavracas Neto 503c3ec04d filesystemmodel: Make function private to gtkfilesystemmodel.c
The _gtk_file_system_model_update_file() function is not used outside
GtkFileSystemModel, so no need to expose it in the header.

Shuffle it around in code, and remove it from the header.
2023-01-07 08:44:40 -05:00
Georges Basile Stavracas Neto 4a5a466975 filesystemmodel: Cleanup unused defines
They were made unused with the removal of GtkTreeModel interface
implementation.
2023-01-07 08:44:34 -05:00
Matthias Clasen e694511da3 Merge branch 'werror-fixes' into 'main'
gtk-launch: Remove compile-time warning

See merge request GNOME/gtk!5400
2023-01-07 13:22:20 +00:00
Matthias Clasen 0a94827b9c Merge branch 'wip/corey/calendar' into 'main'
calendar: Fix marked days

See merge request GNOME/gtk!5399
2023-01-07 13:11:01 +00:00
Corey Berla 735cf301a4 calendar: Set marked days immediately
The marked days are set only as part of gtk_calendar_select_day().
This is insufficient, especially because the day-selected signal
is emitted after the marked days are set in gtk_calendar_select_day().
2023-01-06 20:37:54 -08:00
Corey Berla e8a29f90d1 calendar: Only apply the marked_day to the current month
The marked day gets applied to the current month, and either the previous
or subsequent month if they are visible within the current month.
This doesn't make any sense and likely was an accidental regression
in a6f9052cf1.  Clarify the docs.
2023-01-06 20:21:35 -08:00
Corey Berla 182cc74834 calendar: Add css style for marked days
As part of a6f9052cf1, marked days lost
their style, essentially making that function worthless.  Previously,
they were simply bolded, but that doesn't give them proper justice.
2023-01-06 20:21:35 -08:00
Matthias Clasen 7801dd8944 Merge branch 'wip/phako/fix-activate-action-annotation' into 'main'
widget: Mark format as nullable in activate_action

See merge request GNOME/gtk!4653
2023-01-07 01:06:00 +00:00
Matthias Clasen 38e090f5c1 Merge branch 'main' into 'main'
Fix a typo

See merge request GNOME/gtk!5170
2023-01-07 00:59:32 +00:00
Benjamin Otte 998c382037 build: Turn off tautological-constant-out-of-range-compare warning
This issues a warning when an enum value is compared to a value that is
out of range for the enum.

We do this a lot, either when using -1 for undefined values or when
comparing array sizes to enum values like so:

  enum {
    ONE,
    TWO,
    THREE
  } some_enum_value;
  const char *names= { "one", "two", "three" };

  g_assert (some_enum_value < G_N_ELEMENTS (names));
2023-01-06 19:46:58 -05:00
Benjamin Otte ac81e71f78 gtk-launch: Fix unused variable warning on macOS 2023-01-06 19:46:58 -05:00
Benjamin Otte de271c9a30 ci: Disable -Werror on all subprojects
Would be nice if meson had a nicer way of doing this, but...
2023-01-06 19:46:58 -05:00
Benjamin Otte bf3cf8bb29 glcontext: Avoid gcc warning on non-egl build 2023-01-06 19:46:58 -05:00
Benjamin Otte 63fa5b7f52 gtk-launch: Remove compile-time warning
This warning causes a -Werror build to fail.
2023-01-06 19:46:58 -05:00
Matthias Clasen 96add330f5 Merge branch 'wayland-surface-split3' into 'main'
Split gdksurface-wayland.c

See merge request GNOME/gtk!5217
2023-01-06 22:35:34 +00:00
Matthias Clasen 44aa6a891a Drop gdkpopup-wayland-private.h
It is empty now.
2023-01-06 17:02:03 -05:00
Matthias Clasen 7a30a21405 waylandsurface: Introduce a few vfuncs 2023-01-06 17:00:45 -05:00
Matthias Clasen 2b3eadcfa4 waylandpopup: Drop unused exports 2023-01-06 16:50:20 -05:00
Matthias Clasen 352443d5a5 waylandtoplevel: Drop unused exports 2023-01-06 16:50:20 -05:00
Matthias Clasen 3574fde770 More cleanups 2023-01-06 16:50:20 -05:00
Matthias Clasen 793689789c Misc cleanups
Detangle compute_size, among other things.
2023-01-06 16:50:19 -05:00
Matthias Clasen 120396fa40 wip: Split off GdkWaylandPopup
Like the GdkWaylandToplevel split-off, this needs some
more cleanup.
2023-01-06 16:50:19 -05:00
Matthias Clasen d61ec38974 wip: Split off GdkWaylandToplevel
This still needs some more cleanup.
2023-01-06 16:50:19 -05:00
Matthias Clasen 2a463baed0 wayland: Rearrange the surface code 2023-01-06 16:50:19 -05:00
Matthias Clasen 348acde6bd wayland: Split public headers
Split gdkwaylandsurface.h into itself,
gdkwaylandtoplevel.h and gdkwaylandpopup.h.
This is in preparation for splitting the
types for real.
2023-01-06 13:47:34 -05:00
Matthias Clasen 5ba793842b wayland: Split display_server sub-structs
Move these to GdkWaylandToplevel and GdkWaylandPopup
as appropriate.
2023-01-06 13:47:34 -05:00
Matthias Clasen 149b608bfc wayland: Move next_layout into popup and toplevel
This is where it belongs.
2023-01-06 13:47:34 -05:00
Matthias Clasen 3348ea81f2 wayland: Move pending toplevel state to GdkWaylandToplevel
Another toplevel-only thing.
2023-01-06 13:47:34 -05:00
Matthias Clasen 63e69131bd wayland: Move input_grab_seat to GdkWaylandPopup
This is popup-only functionality.
2023-01-06 13:47:34 -05:00
Matthias Clasen d42a34b0b3 wayland: Move reposition_token to GdkWaylandPopup
This is only used for popups, so move it there.
2023-01-06 13:47:34 -05:00
Matthias Clasen 5ee10fc669 wayland: Move shortcuts_inhibitors to GdkWaylandToplevel
Another toplevel-only feature.
2023-01-06 13:47:22 -05:00
Matthias Clasen b0a4917ce4 wayland: Move imported_transient_for to GdkWaylandToplevel
Another toplevel-only thing.
2023-01-06 13:47:22 -05:00
Matthias Clasen 47e22d6301 wayland: Move geometry hints to GdkWaylandToplevel
Another toplevel-only thing.
2023-01-06 13:47:12 -05:00
Matthias Clasen b970b60503 wayland: Move title to GdkWaylandToplevel
This is a toplevel property.
2023-01-06 13:47:06 -05:00
Matthias Clasen 7406f8165d wayland: Move drag surfaces to their own file 2023-01-06 13:46:58 -05:00
Matthias Clasen 9435e689c3 wayland: Drop create_dnd_surface
It is only used in one place.
2023-01-06 13:46:58 -05:00
Matthias Clasen 66c947b86b Merge branch 'swap-3-4' into 'main'
docs: Place example-{3,4} in numerical order

See merge request GNOME/gtk!5319
2023-01-06 18:06:55 +00:00
Matthias Clasen ad1af87834 Merge branch 'gtk4-fix-xdg-activation-set-surface' into 'main'
gdk/wayland: set requesting surface to xdg-activation

See merge request GNOME/gtk!5293
2023-01-06 14:03:01 +00:00
Matthias Clasen 68700f8722 Merge branch 'drop-file-dialog-shortcuts' into 'main'
filedialog: Drop shortcut folders

See merge request GNOME/gtk!5396
2023-01-06 13:35:14 +00:00
Matthias Clasen f76270167c Merge branch 'wip/otte/for-5496' into 'main'
filedialog: Never set the chooser's file

Closes #5496

See merge request GNOME/gtk!5393
2023-01-06 13:34:55 +00:00
Matthias Clasen 2a442c4fbb Merge branch 'macos-command-symbol' into 'main'
macos: Use Command key symbol in Keyboard shortcuts window

See merge request GNOME/gtk!5296
2023-01-06 13:17:36 +00:00
Matthias Clasen 9356dfc404 filedialog: Drop shortcut folders
The filechooser portal does not support this,
and we are defaulting to using the portal now.
Lets not offer a non-functional API.
2023-01-06 07:40:57 -05:00
Matthias Clasen 7eb8439047 Merge branch 'matthiasc/for-main' into 'main'
testfiledialog: Be more lenient

See merge request GNOME/gtk!5395
2023-01-06 12:34:10 +00:00
Matthias Clasen 0ccf9ad8fc testfiledialog: Be more lenient
Accept both open_multiple and open-multiple.
2023-01-06 07:12:36 -05:00
Arjan Molenaar c52978dfa4 macos: Command should not come from gettext
Instead, just provide the right character.

See also
https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkaccelgroup.c#L916.
2023-01-06 12:08:55 +01:00
Matthias Clasen 52dfa54301 Merge branch 'test-file-dialog' into 'main'
Test file dialog

See merge request GNOME/gtk!5394
2023-01-06 04:28:28 +00:00
Matthias Clasen b6f9e00a9e Add a test for GtkFileDialog 2023-01-05 23:13:58 -05:00
Matthias Clasen 8780aa02d7 filedialog: Cosmetics 2023-01-05 23:06:31 -05:00
Benjamin Otte 8d5a39d765 Merge branch 'wip/corey/dnd-use-cursor' into 'main'
Fix accidental DnD

See merge request GNOME/gtk!5275
2023-01-05 22:39:26 +00:00
Benjamin Otte 446e6a8d62 filedialog: Never set the chooser's file
Instead, get by with setting the name and hope the filechooser figures
things out by itself.

Fixes #5496
2023-01-05 21:30:15 +01:00
Matthias Clasen 9b1bee99b8 Merge branch 'openuri-activation-token' into 'main'
Pass an activation token to OpenURI

See merge request GNOME/gtk!5389
2023-01-05 14:06:14 +00:00
Matthias Clasen 77cf0f1719 Merge branch 'filechooser-multi-folder' into 'main'
filechooser: Don't assert for possible cases

Closes #5494

See merge request GNOME/gtk!5392
2023-01-05 14:01:35 +00:00
Matthias Clasen fc1f1366b4 filechooser: Don't assert for possible cases
switch_to_selected_folder can be called when the
selection contains more than one item. Handle it
like it used to be handled: switch to the first
folder we find.

Fixes: #5494
2023-01-05 08:41:33 -05:00
Matthias Clasen 6efd1a9dad Pass an activation token to OpenURI
The OpenURI portal can take an activation_token
nowadays. So it give one.
2023-01-04 16:39:24 -05:00
Matthias Clasen 8349ae2bc4 x11: Make a call NULL-safe
Make it safe to call gdk_x11_app_launch_context_get_startup_notify_id
with a NULL info.
2023-01-04 16:37:31 -05:00
Matthias Clasen 7c5c843b5b Merge branch 'matthiasc/for-main' into 'main'
Drop gtkmain.c from POTFILES

See merge request GNOME/gtk!5390
2023-01-04 17:22:54 +00:00
Matthias Clasen bc11bc4f8d Drop gtkmain.c from POTFILES
No longer any translations here.
2023-01-04 12:03:01 -05:00
Matthias Clasen be24e4a1f7 Merge branch 'deprecate-toggled' into 'main'
Deprecate gtk_toggle_button_toggled

See merge request GNOME/gtk!5388
2023-01-04 12:57:32 +00:00
Matthias Clasen 918ff1d0f4 Deprecate gtk_toggle_button_toggled
The function is documented as useless.
2023-01-04 07:32:51 -05:00
Anders Jonsson 20723613bc Update Swedish translation 2023-01-04 12:32:38 +00:00
Matthias Clasen 604aafe15d Merge branch 'wip/carlosg/startup-vs-focus' into 'main'
Consider startup vs focus requests for the Wayland platform

See merge request GNOME/gtk!5386
2023-01-03 15:14:35 +00:00
Carlos Garnacho 4041ca0f69 gdkdisplay: Deprecate gdk_display_notify_startup_complete()
We have various layers where we store the startup ID for a request,
since this API does not have a GdkToplevel that we can refer about
for the Wayland platform, this is the most obvious candidate to
start untangling these various layers.

Deprecate this call, it is already unused in the gtk/ side.
2023-01-03 14:58:33 +01:00
Carlos Garnacho 3526d8b299 gtkapplication: Do not call gdk_display_notify_startup_complete()
This should do nothing worthwhile anymore, the X11/Wayland GtkApplication
implementations do already pass the startup ID from the platform_data
via windowing specific APIs, and the application handling the request
via show()/present() should trigger the activation request.
2023-01-03 14:58:33 +01:00
Carlos Garnacho e8adfa2a88 gtkwindow: Shuffle gdk_toplevel_set_startup_id() calls
While this used to be tangential to windows showing or requesting
focus, the xdg-activation Wayland protocol does merge both concepts
together.

But also, for a correct interaction with the compositor, the
toolkit should ideally merge the activation request resulting from
both into the same one, so that the gdk_toplevel_focus() request
replies to the startup token that started the application and
correct focus-stealing prevention/etc happens, instead making up
one just in time for the focus request.

This kind of requires doing things in the right order, a show()
request on the GtkWindow should activate any pending activation
token on the toplevel, a present() request should additionally
create a new token if there was none pending. And
xdg_activation_v1_activate() should happen once on both.

Shuffle the gdk_toplevel_set_startup_id() calls so that this
happens in the right order for Wayland, while making X11 happy
too.
2023-01-03 14:58:33 +01:00
Carlos Garnacho 7fab1b85ad gdk/x11: Emit "remove" s-n message from gdk_toplevel_set_startup_id
In the way towards deprecating gdk_display_notify_startup_complete(),
make gdk_toplevel_set_startup_id() on X11 perform this piece of messaging
itself. It should be harmless that the message is emitted twice, if
callers do still use that API.
2023-01-03 14:58:25 +01:00
Carlos Garnacho 5aeabdb3d4 gdk/wayland: Perform xdg_activation on gdk_toplevel_set_startup_id
This call has everything to perform activation as specified by the
xdg_activation protocol, notably a surface to activate as opposed to
gdk_display_notify_startup_complete().

Make activation happen here, so that the surface gets activated when
its gets a startup ID assigned.
2023-01-03 14:57:49 +01:00
Carlos Garnacho 6f01f846dc gtkwindow: Minor refactor
Move the handling of the startup ID to a separate function, since
this will be called from several places.
2023-01-03 14:57:44 +01:00
Matthias Clasen 3c4f6144a0 Merge branch 'fix-introspection' into 'main'
meson.build: build introspection according to option only

See merge request GNOME/gtk!5382
2023-01-03 11:56:49 +00:00
Alexander Kanavin ae71d338d7 meson.build: build introspection according to option only
The way the check is written, if the build is native, then the
introspection option has no effect.

Particularly yocto project does want to disable introspection in
native builds and enable it in cross builds (both via the option),
and without this patch the former is not possible.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
2023-01-03 08:26:07 +01:00
Matthias Clasen 8b469a2727 Merge branch 'nullable-gdk' into 'main'
gdk_display_open: Mark arg as nullable

See merge request GNOME/gtk!5380
2023-01-03 00:25:55 +00:00
Matthias Clasen 53813f24f0 Merge branch 'matthiasc/for-main' into 'main'
ci: Enable introspection for the docs build

See merge request GNOME/gtk!5383
2023-01-02 21:53:58 +00:00
Matthias Clasen 1fde83f12b Merge branch 'direction-from-language' into 'main'
Determine direction from language

See merge request GNOME/gtk!5385
2023-01-02 21:50:54 +00:00
Matthias Clasen 1f7783224b Determine direction from language
We can determine the direction to return here
without relying on translations, by using pango
and HarfBuzz apis to go
language -> script -> direction.
2023-01-02 16:30:27 -05:00
Matthias Clasen 0d04ceda76 Merge branch 'ccook/doc-changes-2' into 'main'
Various documentation suggests across a few domains.

See merge request GNOME/gtk!5384
2023-01-02 20:40:54 +00:00
Cam Cook 9396ccf9ff Various documentation suggests across a few domains.
| domain | current | suggestion |
|--------|---------|------------|
| [GtkSeparator](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkseparator.c#L39)    | "`![An example GtkSeparator](separators.png)`" | "`![An example GtkSeparator](separator.png)`" [1] |
| [GtkTextBuffer](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbuffer.c#L4885)  | "if there is an redoable action" | "if there is a redoable action" |
| [GtkTextBuffer/get_enable_undo](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbuffer.c#L5005) | (Renders `No description available.`) | "Returns: %TRUE if undoing and redoing changes to the buffer is allowed." [3] |
| [GtkTextBuffer/get_max_undo_levels](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbuffer.c#L5102) | (Renders `No description available.`)| "Returns: The max number of undo levels allowed (0 indicates unlimited)." |
| [GtkTextBuffer](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbuffer.c#L3874) | "with gtk_text_buffer_add_selection_clipboard()." | "with [method@Gtk.TextBuffer.add_selection_clipboard]" |
| [GtkTextBuffer](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbuffer.c#L3494) | "it will automatically toggled" | "it will automatically toggle" |

* [1] See : [separator.png](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/docs/reference/gtk/images/separator.png), [gtk4.toml.in](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/docs/reference/gtk/gtk4.toml.in#L218), [visual_index.md](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/docs/reference/gtk/visual_index.md?plain=1#L16)
* [2] Taken from `enable-undo` [property description](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbuffer.c#L516)

* [GtkTextMark/gtk_text_mark_set_visible](https://docs.gtk.org/gtk4/method.TextMark.set_visible.html) is defined in [GtkTextMark's header](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextmark.h#L93), but implemented in [GtkTextBTree](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbtree.c#L3036).
  * Other than being kind of confusing, this causes `gtk_text_mark_set_visible()`'s doc to not render where it expects it to.
2023-01-02 13:47:55 -05:00
Matthias Clasen 5a68639788 ci: Enable introspection for the docs build
It is required, so lets not rely on defaults.
2023-01-02 11:27:22 -05:00
Matthias Clasen 85df554ec1 Fix compiler warnings 2023-01-02 11:18:54 -05:00
Matthias Clasen 8776ebfe90 Merge branch 'dependency-review' into 'main'
Dependency review

See merge request GNOME/gtk!5381
2023-01-02 16:14:24 +00:00
Matthias Clasen 83eee03b0f build: Use the current gdk-pixbuf as subproject
This commit has fixes for subproject use that we need,
and is not in a release yet.
2023-01-02 10:57:52 -05:00
Matthias Clasen d7bba4ebac build: Use libcloudproviders 0.3.1 as subproject 2023-01-02 10:57:52 -05:00
Matthias Clasen 40e2b5b153 build Use current libepoxy as subproject
We need recent fixes for graphene subproject use,
so use the current HEAD of master until there is
a release with these fixes.
2023-01-02 10:57:52 -05:00
Matthias Clasen f7a7313758 build: Use the current graphene as subproject
We need recent fixes for graphene subproject use,
so use the current HEAD of master until there is
a release with these fixes.
2023-01-02 10:57:52 -05:00
Matthias Clasen 2d9ce0357f build: Use wayland 1.21.0 as subproject 2023-01-02 10:57:52 -05:00
Matthias Clasen 0ea05896df build: Use wayland-protocols 1.25 as subproject 2023-01-02 10:57:52 -05:00
Matthias Clasen 8c638df147 build: Use pango 1.50.12 as subproject 2023-01-02 10:57:52 -05:00
Matthias Clasen 6605ded4c9 build: Use fribidi 1.0.12 as subproject 2023-01-02 10:57:52 -05:00
Matthias Clasen ba1a9530c8 build: Use cairo 1.17.6 as subproject
We don't want to use cairo 1.16, since it is
too old, so use 1.17.6 for now until there
is a stable 1.18 release.
2023-01-02 10:57:52 -05:00
Matthias Clasen a9fcea369e build: Use glib 2.74.4 as subproject
This is the latest stable release.
2023-01-02 10:57:44 -05:00
Matthias Clasen ca2787fbba build: Pass gobject_types=true to graphene
This is required for graphene-gobject to be built.
2023-01-02 09:15:59 -05:00
Matthias Clasen 6d2c897dfc build: Bump introspection dep to 1.72
This should be kept in sync with glib.
2023-01-02 09:15:56 -05:00
Matthias Clasen 01f81b2d77 build: Bump graphene req to 1.10
So we don't require an unstable version.
2023-01-02 09:15:56 -05:00
Sabri Ünal 8a3c5c63e8 Update Turkish translation 2023-01-02 13:58:10 +00:00
Maximiliano Sandoval R b688f47776 gdk_display_open: Mark arg as nullable 2023-01-02 11:49:06 +01:00
Matthias Clasen e126110ae0 Merge branch 'wide-inspector' into 'main'
inspector: Avoid super-wide window

See merge request GNOME/gtk!5379
2022-12-31 20:07:45 +00:00
Matthias Clasen f98406b080 Merge branch 'annotate-dialog-deprecation' into 'main'
docs: Annotate GtkDialog deprecation

See merge request GNOME/gtk!5376
2022-12-31 20:07:20 +00:00
Matthias Clasen 40a2910262 inspector: Avoid super-wide window
Ellipsize values that can get long, to avoid
forcing an excessively wide window.
2022-12-31 12:30:40 -05:00
Marco Melorio ec84077486 docs: Annotate GtkDialog deprecations 2022-12-30 15:37:11 +01:00
Benjamin Otte 188f9269b7 Merge branch 'wip/corey/list-item-visible' into 'main'
listitemwidget: Setup factory only once the widget is visible

See merge request GNOME/gtk!5374
2022-12-29 22:21:43 +00:00
Corey Berla 7ad693f865 gtkcolumnviewcolumn: Only create cells when the column is visible
It's a big performance drag to create many cells (and their associated
widgets) for columns that may never be shown. Only create cells
is the column is visible, and subsequently create/remove cells
when in column_set_visible.
2022-12-29 11:11:40 -08:00
Yosef Or Boczko 913e3680f3 Update Hebrew translation 2022-12-27 21:46:52 +00:00
Matthias Clasen f3ad6015c6 Merge branch 'wip/corey/notify-drop-value' into 'main'
gtkdroptarget: Notify value property on local drag

See merge request GNOME/gtk!5372
2022-12-27 16:45:16 +00:00
Corey Berla 4e694c1824 gtkdroptarget: Notify value property on local drag
The value property is only getting notified when it's unset
or when it's set from gdk_drop_real_value_async().  Make sure
to always notify :value when its changed
2022-12-27 08:11:53 -08:00
Matthias Clasen 0214cb5b1b Post-release version bump 2022-12-26 07:22:39 -05:00
Matthias Clasen 12bd668f4d 4.9.2 2022-12-26 06:41:21 -05:00
Matthias Clasen f7fb069e2f Updates 2022-12-25 09:25:45 -05:00
Matthias Clasen 7213bf5b09 Merge branch 'wip/otte/for-main' into 'main'
GtkDialog: Various API changes

See merge request GNOME/gtk!5251
2022-12-24 15:14:17 +00:00
Matthias Clasen 5eb4a3af0d filedialog: Handle initial-folder being NULL
This showed up as test failure in ci.
2022-12-24 09:01:16 -05:00
Benjamin Otte c4c747d2ad alertdialog: Rephrase docs for show() a bit
In particular, discuss what to do about cancellables.

Related: !5326
2022-12-24 07:56:57 -05:00
Benjamin Otte 671fad5f34 filedialog: Clarify interaction of :filters and :default-filter 2022-12-24 07:56:57 -05:00
Benjamin Otte 1b9c45b660 filedialog: Rename :current-filter to :default-filter
The last "current" removed from properties. None of these are current.
2022-12-24 07:56:57 -05:00
Benjamin Otte e2f730c0bf filedialog: Add gtk_file_dialog_set_initial_file()
A shortcut for setting initial-folder and initial-name at the same time.

We can remove all arguments from the actual async calls this way.
2022-12-24 07:56:57 -05:00
Benjamin Otte 8a2d35b9fb filedialog: Add gtk_file_dialog_set_initial_name() 2022-12-24 07:56:57 -05:00
Benjamin Otte 26cec4a021 filedialog: Rename current-folder to initial-folder
It's not the current one - unlike in GtkFileChooser - because there are
no live updates. So we use a more descriptive name.
2022-12-24 07:56:57 -05:00
Benjamin Otte 8d8e83afa2 fontdialog: Handle Escape better
Closing the dialog by hitting Escape should
have the same effect as clicking the cancel
button. Make it so.
2022-12-24 07:56:57 -05:00
Benjamin Otte 381bb84f3d alertdialog: Bring the GError back
Make sure we have a GError, so that dismissing and cancelling can be
separated.
2022-12-24 07:56:57 -05:00
Benjamin Otte 977fedfdf1 dialog: GTK_DIALOG_ERROR_ABORTED => GTK_DIALOG_ERROR_CANCELLED
This is done via the GCancellable, so let's call it cancelling.
2022-12-24 07:56:57 -05:00
Benjamin Otte 8957302bd4 dialog: GTK_DIALOG_ERROR_CANCELLED => GTK_DIALOG_ERROR_DISMISSED
The term "cancelling" is used with GCancellable, a user clicking a close
button is not that.
User input is usually described as "dismissing", so we use that term.
2022-12-24 07:56:57 -05:00
Benjamin Otte 8a7f739f9f directorylist: Always add standard::name
glib can't figure out how to do that, so we need to do that ourselves.
2022-12-24 07:56:57 -05:00
Matthias Clasen fce4810fb4 Merge branch 'ccook/doc-changes-1' into 'main'
Various spelling mistakes across a few domains that show up in documentation.

See merge request GNOME/gtk!5370
2022-12-24 12:52:19 +00:00
Matthias Clasen d5ba76a82c Merge branch 'wip/carlosg/autohide-checks-on-x11' into 'main'
gdk/surface: Handle clicks outside client surfaces

See merge request GNOME/gtk!5369
2022-12-24 12:50:09 +00:00
Cam Cook 1cd44ec7b7 Make stylecheck happy 2022-12-23 11:21:18 -05:00
Cam Cook 424d56830a Merge remote-tracking branch 'upstream/main' into ccook/doc-changes-1 2022-12-23 11:02:18 -05:00
Cam Cook 7fc4d02851 Various spelling mistakes across a few domains that show up in documentation.
| domain | current | suggestion |
|--------|---------|------------|
| [GtkAspectFrame](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkaspectframe.c#L457)    | "requistion of the child" | "requisition of the child" |
| [GtkPaned](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkpaned.c#L2500)               | "(attributes org.gtk.Method.set_propery=wide-handle)" | "(attributes org.gtk.Method.set_property=wide-handle)"|
| [GtkPopover](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkpopover.c#L2484)           | "with gtk_popover_set_offset()." | "with [method@Gtk.Popover.set_offset()]." |
| [GtkPopoverMenu](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkpopovermenu.c#L859)    | "with gtk_popover_menu_add_child()" | "with [method@Gtk.PopoverMenu.add_child()]" |
| [GtkSelectionModel](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkselectionmodel.c#L316) | "the queired range" | "the queried range" |
| [GtkScrolledWindow](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkscrolledwindow.c#L76) | "automatically removed hen" | "automatically removed when"|
| [GtkSearchBar](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtksearchbar.c#L425)         | "Connects the \`GtkEditable widget" | "Connects the `GtkEditable` widget" |
2022-12-23 11:01:07 -05:00
Carlos Garnacho e7f798dcf5 gdk/surface: Handle clicks outside client surfaces
The owner_events=TRUE grab makes GDK on X11 see events happening
outside every client window as received on the grab window.
Additionally check that the pointer is inside the grab window
(i.e. it received GDK_CROSSING_NORMAL crossing events for the
core pointer) in order to handle clicks happening outside client
windows.

These new paths are expected to be a no-op on Wayland, and to
also work for touchscreen input on X11, due to emulated pointer
events.
2022-12-23 16:12:03 +01:00
Yuri Chornoivan f6bd63c9ad Update Ukrainian translation 2022-12-23 13:49:23 +00:00
Matthias Clasen 99320f99c3 Merge branch 'wip/ignazp/clipboard_eol' into 'main'
clipboard: improve EOL conversion of plain text

See merge request GNOME/gtk!5367
2022-12-22 13:31:07 +00:00
Ignazio Pillai 8ecb624934 clipboard: improve EOL conversion of plain text
Handle the case of clipboard text with CR line endings
2022-12-22 12:55:30 +01:00
Matthias Clasen 123eebb93d Merge branch 'tweak-gtkfilechooser-button-tooltips' into 'main'
GtkFileChooser: Tweak Grid View & List View button tooltips

See merge request GNOME/gtk!5345
2022-12-21 12:39:53 +00:00
Emmanuele Bassi b6596d5313 Merge branch 'remove_a11y_name_fallback' into 'main'
Don't present GTK class names to assistive technologies even as a fallback

Closes gnome-control-center#2244

See merge request GNOME/gtk!5365
2022-12-21 11:06:20 +00:00
Lukáš Tyrychtr ffe333a21f Don't present GTK class names to assistive technologies even as a fallback
A screen reader user is not interested in GTK internals, for example,
he does not care whether a button is an image button or not,
and a screen reader will report the fact that it is a button anyway.
Same applies for GtkEntry widgets, for example.

This actually is sufficient to fix gnome-control-center#2244.
And, according to the discussion in #5145, it should be fine.
2022-12-21 11:35:46 +01:00
Matthias Clasen 257ca10eb1 Merge branch 'file-nullable' into 'main'
filelauncher: Make set_file argument nullable

See merge request GNOME/gtk!5357
2022-12-21 03:23:58 +00:00
Benjamin Otte ae097d9674 Merge branch 'wip/antoniof/listbase-rubberband-better-fix' into 'main'
listbase: Cancel rubberband if not handling drag

See merge request GNOME/gtk!4831
2022-12-21 01:14:57 +00:00
Luca Bacci 1659c59410 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 16:08:11 +00:00
Luca Bacci cf91e09d75 Include hicolor index.theme as a resource
index.theme file copied from upstream xdg/default-icon-theme
repository at tag 0.17:

https://gitlab.freedesktop.org/xdg/default-icon-theme/-/tree/0.17

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5303
2022-12-20 16:30:00 +01:00
Emmanuele Bassi 020636c49f Merge branch 'revert-09691ead' into 'main'
Revert "Merge branch 'include-hicolor-index-theme-as-resource' into 'main'"

See merge request GNOME/gtk!5360
2022-12-20 15:22:28 +00:00
Luca Bacci 59df956f4f Revert "Merge branch 'include-hicolor-index-theme-as-resource' into 'main'"
This reverts merge request !5341
2022-12-20 13:23:51 +00:00
Matthias Clasen 09691ead4c Merge branch 'include-hicolor-index-theme-as-resource' into 'main'
Include hicolor index.theme as a resource

Closes #5303

See merge request GNOME/gtk!5341
2022-12-20 12:24:25 +00:00
Maximiliano Sandoval R 18a7f715c4 filelauncher: Make set_file argument nullable 2022-12-20 11:08:47 +01:00
Aleksandr Melman d1347bbf33 Update Russian translation 2022-12-20 09:33:25 +00:00
Matthias Clasen 1b816c91d0 Merge branch 'fix-asan-more' into 'main'
ci: Disable f16c for asan

See merge request GNOME/gtk!5356
2022-12-20 06:04:46 +00:00
Matthias Clasen 5df0cbfa69 ci: Disable f16c for asan
It appears that f16c crashes asan instantly.
2022-12-20 00:43:59 -05:00
Matthias Clasen 47b5d0d546 Merge branch 'no-more-installed-tests' into 'main'
build: Drop the install-tests option

See merge request GNOME/gtk!5352
2022-12-20 05:33:56 +00:00
Matthias Clasen 4f65c121b7 ci: More verbose output from asan 2022-12-20 00:32:51 -05:00
Matthias Clasen a0de7884cd Merge branch 'another-flaky-reftest' into 'main'
ci: Declare a reftest as flaky

See merge request GNOME/gtk!5354
2022-12-20 05:07:51 +00:00
Matthias Clasen b5b9cb189f Merge branch 'macos-ci-is-iffy' into 'main'
ci: Mark macos build as allow-fail

See merge request GNOME/gtk!5355
2022-12-20 05:02:25 +00:00
Matthias Clasen ee2152ff5c ci: Mark macos build as allow-fail
It fails too often, and it never does us
any good.
2022-12-19 23:55:13 -05:00
Matthias Clasen d8d5cace2a ci: Declare a reftest as flaky
fixed-widget-stacking is failing frequently due
to a blinking cursor showing up in one of the
windows in ci.
2022-12-19 23:52:51 -05:00
Matthias Clasen 21e9a508bd Merge branch 'fix-gtk_doc=true' into 'main'
meson: Require gi-docgen when gtk_doc is required

See merge request GNOME/gtk!5351
2022-12-20 04:17:22 +00:00
Matthias Clasen 3121f88265 build: Drop the install-tests option
We no longer use installed tests in CI,
so lets reap the benefit and simplify
our build setup for tests.
2022-12-19 23:12:47 -05:00
Matthias Clasen b56224fc16 Merge branch 'fix-introspection-test-deps' into 'main'
build: Lift gir and build_gir to toplevel

See merge request GNOME/gtk!5350
2022-12-20 04:04:17 +00:00
Nirbheek Chauhan 4346a33a63 meson: Require gi-docgen when gtk_doc is required
Fixes build with only `-Dgtk_doc=true` without
`-Dintrospection=enabled`:

    Program gi-docgen found: NO
    Configuring gdk4.toml using configuration

    docs/reference/gdk/meson.build:13:2: ERROR: Tried to use not-found external program in "command"

`introspection` is `auto` by default.

The rest of the docs build is only contingent on
`if get_option('gtk_doc')` so we should use the same restriction here.

We check for `build_gir` below already, and the gi-docgen subproject
itself does not need gobject-introspection so it's fine to do it like
this.
2022-12-20 09:27:48 +05:30
Matthias Clasen 596f59f471 tests: Maybe skip introspection tests
If we don't find the python gi module,
skip the introspection test.
2022-12-19 22:38:38 -05:00
Matthias Clasen d758754f20 build: Lift gir and build_gir to toplevel
build_gir is used in multiple subdirectories,
so it is a bit nasty that it is defined in
one too.
2022-12-19 22:38:38 -05:00
Emmanuele Bassi e049b6992d Merge branch 'ebassi/ci-image-for-main' into 'main'
Various CI fixes

See merge request GNOME/gtk!5349
2022-12-20 03:37:43 +00:00
Emmanuele Bassi ca0bae2196 ci: Don't cache subprojects
We're downloading them anyway.
2022-12-20 02:41:52 +00:00
Matthias Clasen a920c0d2de Merge branch 'wip/gtk4-fix-delete-surrounding' into 'main'
gtkimcontextwayland: Convert byte based offset to char based offset in delete_surrounding_text

See merge request GNOME/gtk!5254
2022-12-20 02:40:14 +00:00
Emmanuele Bassi 0db3666d3c tests: Add shorthand-entry-border to the flaky suite
This test fairly consistently times out when running in a contended CI.
2022-12-20 02:18:25 +00:00
Emmanuele Bassi 2b808bf849 ci: Remove installed-tests job
Installed tests require access to the system prefix, and thus a
system-wide installation of Meson, which we don't have.

We're going to restore this job at a later date.
2022-12-20 01:56:28 +00:00
Emmanuele Bassi 737342ef23 ci: Don't use builddep to install Wayland build dependencies
We don't want to bring undefined dependencies into the image.

Additionally, Wayland depends on Meson, and we don't want to use
Fedora's version of Meson.
2022-12-20 01:54:57 +00:00
Emmanuele Bassi cf709473f7 ci: Update the Fedora image 2022-12-20 01:54:57 +00:00
Alynx Zhou ad83d616c4 gtkimcontextwayland: Convert byte based offset to char based offset in delete_surrounding_text
ClutterInputFocus/GtkIMContext uses char based offset for
delete_surrounding, however, text_input_v3 uses byte based offset for
it. Currently only GTK with mutter can work correctly via text_input_v3
because they both forget to convert between char based offset and byte
based offset.

This commit fixes it in GTK by converting byte based offset to char
based offset with the UTF-8 encoded surrounding text.

Fixes <https://gitlab.gnome.org/GNOME/gtk/-/issues/4566>.
2022-12-20 09:51:08 +08:00
Matthias Clasen 98bb14a849 Merge branch 'meson-subproject-usage-fixes' into 'main'
Various fixes for using gtk4 as a meson subproject

See merge request GNOME/gtk!5347
2022-12-20 01:50:47 +00:00
António Fernandes efbd228940 listbase: Cancel rubberband if not handling drag
If the drag events are claimed by another gesture (e.g. a GtkDragSource
in an item widget), list base still commits a rubberband selection, for
a rubberband which wasn't even visible yet. This is a problem for the
GNOME Files application which needs both rubberbanding and drag-n-drop.

My previous fix[0] was enough for the case where the event sequence is
claimed right before the first GtkDragGesture::drag-update emission,
but it's useless if the event is claimed later (e.g. after the drag
treashold), because a rubberband already exists by that time.

Therefore, the complete solution requres checking whether the event
sequence is no longer being handled by our gesture, and commit the
selection changes only if it is, but otherwise cleanup the rubberband.

This is what GtkFlowBox does already, so let's do the same here.

[0] commit dc4540fae9
2022-12-18 21:31:31 -10:00
Nirbheek Chauhan 64c8da1bdd ci: Always update subprojects to latest revision
Otherwise we're not actually updating anything. `meson subprojects
download` will skip subprojects that already exist.
2022-12-19 09:08:28 +05:30
Nirbheek Chauhan 7242408d60 ci: Fix fedora-mingw64 job 2022-12-19 03:09:11 +05:30
Nirbheek Chauhan 9c6dd9b3b5 ci: Update meson version used for vs2017 job 2022-12-19 03:09:11 +05:30
Nirbheek Chauhan cd77936265 meson: Fix find_program and subproject usage
Dummy dependencies are not required to execute a subproject
automatically for providing a program, nor do you need to explicitly
call subproject() to do that.

A `[provide]` section in the wrap file is enough.
2022-12-19 03:09:11 +05:30
Nirbheek Chauhan 53c37cfc17 meson: Stop using fallback: kwarg for deps that don't need it
Subprojects that use meson.override_dependency() do not require the
caller to provide the dependency variable name inside the subproject.

We also don't want to provide the *subproject* name, because the
subproject name can be `pango-1.50.12` instead of `pango` when using
wrap-file to download the tarball instead of using wrap-git. This
causes the pango subproject to be executed twice when using gtk as
a subproject inside gstreamer (which uses pango-1.50.12 as
a wrap-file).

All the dependencies we use can be switched in this way, but the
remaining ones need to be changed to use meson.override_dependency()
first.
2022-12-19 03:09:11 +05:30
Nirbheek Chauhan 1a1f92178e meson: Update gitlab.gnome.org SSH server names
Also switch the wrap file style to use spaces around `=` which is the
canonical style used by wrapdb now.
2022-12-18 21:42:03 +05:30
Nirbheek Chauhan 6b111a9fda meson: Remove redundant, duplicate, harfbuzz check 2022-12-18 21:42:03 +05:30
Nirbheek Chauhan cc6b0c5750 meson: Always look for both cmake and pkgconfig names
The is_msvc_like change is wrong; it used a false correlation between
"compiler being used" and "dependency method" by saying that on
Windows, when building with MSVC, you will only use CMake to find png,
jpeg, tiff.

You can use pkgconfig to find these deps on Windows with MSVC -- when
the deps have been built with Autotools or Meson (with MSVC). You can
also find these deps using CMake on other platforms like macOS or
Linux.

The solution is simple: just search for both names on all platforms,
and just search for the pkgconfig name first.
2022-12-18 21:42:03 +05:30
Matthias Clasen 235f01952c Merge branch 'nirbheek/fix-build-with-latest-glib' into 'main'
gdk: Fix g_set_str version check

See merge request GNOME/gtk!5348
2022-12-18 16:07:11 +00:00
Nirbheek Chauhan e2291259bb gdk: Fix g_set_str version check
The function was added to glib in 2.75.1. This fixes gtk's build with
the glib main branch.
2022-12-18 11:29:10 +05:30
sunflowerskater 6b71ccdb43 GtkFileChooser: Tweak Grid View & List View button tooltips
The tooltips from the Grid View & List View buttons are unnecessarily long and look different from the tooltips used in Nautilus.

This commit makes the tooltips to be consistent with Nautilus and, consequently, makes them shorter.
2022-12-17 18:21:10 -03:00
Matthias Clasen c81a793f63 Merge branch 'wip/cdavis/file-dialog-accept-label' into 'main'
gtkfiledialog: Allow devs to set custom accept labels

Closes #5421

See merge request GNOME/gtk!5339
2022-12-16 17:04:00 +00:00
Christopher Davis 143229f829 gtkfiledialog: Allow devs to set custom accept labels
Accept labels can be used for additional context regarding
the purpose of a file. The old GtkFileChooser APIs allowed
developers to set it, but the initial FileDialog API was missing
this functionality.

This commit adds `gtk_file_dialog_set_accept_label ()` to
restore the missing functionality.

Closes https://gitlab.gnome.org/GNOME/gtk/-/issues/5421
2022-12-16 10:16:52 -05:00
Christopher Davis 3e86bc65f5 gdkprivate: Add compatibility shim for g_set_str()
Allows us to make use of this API without depending
on bleeding-edge glib
2022-12-16 10:16:52 -05:00
Luca Bacci b563736b66 Include hicolor index.theme as a resource
index.theme file copied from upstream xdg/default-icon-theme
repository at tag 0.17:

https://gitlab.freedesktop.org/xdg/default-icon-theme/-/tree/0.17

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5303
2022-12-16 14:58:59 +01:00
Matthias Clasen 2442ed87fe Merge branch 'matthiasc/for-main' into 'main'
Silence a compiler warning

See merge request GNOME/gtk!5340
2022-12-16 12:30:26 +00:00
Matthias Clasen 6cb5f20942 Silence a compiler warning 2022-12-16 00:12:44 -05:00
Matthias Clasen aafc6279a3 Merge branch 'ebassi/ci-image-for-main' into 'main'
ci: Install Meson in the build jobs

See merge request GNOME/gtk!5335
2022-12-16 03:55:18 +00:00
Matthias Clasen 2154460139 Merge branch 'no-portals' into 'main'
Add GDK_DEBUG=no-portals

Closes #5441

See merge request GNOME/gtk!5336
2022-12-15 16:27:33 +00:00
Matthias Clasen ef17a44876 Merge branch 'deprecate-show-hide' into 'main'
Deprecate gtk_widget_show/hide

See merge request GNOME/gtk!5278
2022-12-15 14:53:48 +00:00
Matthias Clasen 8eace1c385 Merge branch 'check-button-radio-docs' into 'main'
gtkcheckbutton: Document how to keep track of changes for radio buttons

See merge request GNOME/gtk!5328
2022-12-15 00:25:08 +00:00
Benjamin Otte 1f001a8f6a Merge branch 'wip/corey/listbase-focus' into 'main'
listbase: Use set_focus_child properly

Closes #5433 and #5432

See merge request GNOME/gtk!5169
2022-12-14 19:06:57 +00:00
Emmanuele Bassi a2b00f7ea7 ci: Install tests in a separate prefix
Avoid using `sudo` in the installed-tests CI job, since we're installing
Meson as the current user.
2022-12-14 19:02:23 +00:00
Pablo Correa Gómez 42ba97eb5c gtkcheckbutton: Document how to keep track of changes for radio buttons 2022-12-14 20:02:07 +01:00
Matthias Clasen e5560c1535 Add GDK_DEBUG=no-portals
Fixes: #5441
2022-12-14 13:50:20 -05:00
Emmanuele Bassi 7fca091371 ci: Redefine PATH 2022-12-14 18:39:34 +00:00
Corey Berla 93e591fdf1 listbase: Use set_focus_child properly
The EventControllerFocus on the list item, updates the list base focus
tracker and scrolled to position any time the list item enters focus.
This works when interacting within a single window, but has unexpected
results when changing focus between multiple windows.

Instead of using the focus controller workaround, just make
gtk_list_base_update_focus_tracker the set_focus_child vfunc

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5433
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5432
2022-12-14 07:56:57 -10:00
Corey Berla 7081bfc614 listbase: Split scroll_to_item for reuse 2022-12-14 07:51:34 -10:00
Emmanuele Bassi cd7627ed02 ci: Consistently use meson subcommands
meson setup:
  configuration
meson compile:
  compilation
meson install
  installation

Do not use ninja directly, and do not use `meson` as a synonym for
`meson setup`.
2022-12-14 17:44:27 +00:00
Emmanuele Bassi ce9069c85f build: Add known to be failing gsk comparison tests
The unaligned-offscreen and upside-down-label-3d tests are failing after
upgrading our CI images, seemingly because of some font rendering issue
that is hard to track. Let's use the "failing" testsuite mechanism that
we also use for the reftests.
2022-12-14 17:40:04 +00:00
Emmanuele Bassi 6e0def6474 ci: Install Meson in the build jobs
We use the latest 0.64 even if we depend on 0.60 because of fixes in the
subproject command.
2022-12-14 17:13:03 +00:00
Matthias Clasen a471a8b57c Merge branch 'ebassi/gidocgen-update' into 'main'
ci: Update the gi-docgen dependencies

See merge request GNOME/gtk!5263
2022-12-14 16:24:48 +00:00
Georges Basile Stavracas Neto b0f65ead84 Merge branch 'gbsneto/filechooser-grid-view' into 'main'
Add GtkGridView to the filechooser

Closes #233

See merge request GNOME/gtk!5163
2022-12-14 14:47:21 +00:00
Matthias Clasen e3f805f169 Merge branch 'appdialog' into 'main'
Add GtkAppDialog

See merge request GNOME/gtk!5284
2022-12-14 13:24:20 +00:00
Luca Bacci 48bcae99af Merge branch 'gdk-win32-fix-native-decoration-resize' into 'main'
GdkWin32: Fix resizes with native decorations

Closes #5142, #5088, and #5090

See merge request GNOME/gtk!5096
2022-12-14 13:13:14 +00:00
Danial Behzadi 355b42b373 Update Persian translation
(cherry picked from commit aabae92482)
2022-12-14 12:33:20 +00:00
Luca Bacci 0bdf30dfbf Merge branch 'gdk-win32-modal-handling' into 'main'
GdkWin32: Do not use MA_NOACTIVATEANDEAT

Closes #5297 and #5326

See merge request GNOME/gtk!5208
2022-12-14 10:08:42 +00:00
Corey Berla e8f70be2c1 Merge branch 'wip/otte/for-5422' into 'main'
contentserializer: Serialize to file:// if possible

Closes #5422

See merge request GNOME/gtk!5330
2022-12-14 01:56:04 +00:00
Benjamin Otte ea056d261f contentserializer: Serialize to file:// if possible
Try to get a native file:// URI instead of any other GVFS
scheme, for interoperability with apps only handling file:// URIs.

This is what GTK3 Nautilus and Thunar do, so apps should be tuned
for this behavior.

See also https://bugzilla.xfce.org/show_bug.cgi?id=13845

Fixes: #5422
2022-12-14 02:33:45 +01:00
Matthias Clasen c2c99a163a Merge branch 'stylanydev' into 'main'
Gtk.GestureStylus: implement `anydev` property

See merge request GNOME/gtk!4707
2022-12-13 19:34:12 +00:00
Matthias Clasen eec8cf1309 Deprecate gtk_widget_show/hide
gtk_widget_set_visible does the same job.
2022-12-13 13:46:02 -05:00
Matthias Clasen 18e0eaa9d6 tests: Stop using gtk_widget_show/hide 2022-12-13 13:46:02 -05:00
Matthias Clasen b8962fcba7 examples: Stop using gtk_widget_show/hide 2022-12-13 13:46:02 -05:00
Matthias Clasen fba4cea2e8 testsuite: Stop using gtk_widget_show/hide 2022-12-13 13:46:02 -05:00
Georges Basile Stavracas Neto 8cf9810240 pathbar: Reimplement using GtkBox
The path bar does a lot of manual management of buttons, mostly to
be able to show navigation arrows when there's not enough space to
show the full path.

Since the GTK4 migration, this is slightly broken in some cases, due
to the 'need_sliders' variable being always set to TRUE. Furthermore,
after the introduction of the Recent button as a special cased fake
root, the allocation of the buttons is generating warnings.

Reimplement the path bar as a GtkBox, inside a GtkScrolledWindow.
This mimics what Nautilus does, and allows us to make navigation more
predictable, and remove most of the complexity from GtkPathBar. It
also prevents it from generating allocation warnings.

The path bar itself now doesn't override GtkWidget.measure nor
GtkWidget.allocate; instead, it delegates layout to the GtkBinLayout
layout manager.

CSS is adjusted to account for the changed hierarchy of buttons.
2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto f0a76f2ca8 filechooserwidget: Improve grid cell visuals
Use a GtkLabel instead of a GtkInscription to get filenames better
displayed within the available space.
2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto 358d9d72d1 filechooserwidget: Don't check operation mode for tooltip
There's no way this could ever have been correct. We always want to
show the tooltip, and it's basically always available.
2022-12-13 14:45:15 -03:00
Sam Hewitt aabb8dce91 filechooser: Add hover styles to the gridview children 2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto 80736d782b filechooserwidget: Add toggle view button clone in search
It's positioned and looks exactly like the browse_toggle_view_button,
but due to the way things are organized, we cannot simply reuse that
button.

Add a clone of browse_toggle_view_button in the search entry page of
the toolbar stack. Make it toggle the same action as of the original
button, and bind the icon name and tooltip texts to it too.
2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto 1464289710 filechooserwidget: Show pathbar in recent mode
As per design direction, show the pathbar in recent mode.
2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto 72c676aecb pathbar: Special case recent button
Soon pathbar will be shown on the Recent mode, with a static
path pointing to, well, Recent, so special case it in the
GtkPathBar with a static icon.
2022-12-13 14:45:15 -03:00
Corey Berla c717d10dda filechooserwidget: Hide ColumnView settings in GridView 2022-12-13 14:45:15 -03:00
Matthias Clasen ee5324359d filechooser: Save and restore view type
With this, the filechooser comes up with the
same view (grid or list) that it had the last
time you used it.
2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto 10338a5237 filechooserwidget: Rename callback
It's shared between both column and grid views now.
2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto 1c5caf53b6 filechooserwidget: Implement 'keynav-failed' for grid view
It's exactly the same as of the column view. Since we're sharing
the callback now, rename it to browse_files_view_keynav_failed_cb.
2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto 0bb6377a3a filechooserwidget: Use correct view in various places
Most of the pointer comparisons against 'browse_files_column_view'
should actually be performed against the current view widget. As
it turns out, it weren't that many places after all.
2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto ce12ab8307 style: Improve filechooser grid view slightly 2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto 27613e3bc5 filechooserwidget: Add a grid view
Add a grid view outside of the widgetry tree. The grid view mimics
the column view using bindings, so we only need to manage the column
view.

Also add a button in the path bar section to toggle the view. This
is handled as a new 'toggle-view' action in the file chooser.

The way switching between views currently work is by setting either
the column or grid view as the child of the GtkScrolledWindow. This
has the benefit of unmapping the unused view, which is nice and can
avoid some tricky situations with thumbnails.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/233
2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto a9be0be32b filethumbnail: Add 'icon-size' property
This will be used by future commits so that we can reuse this widget
in the file chooser grid view.
2022-12-13 14:45:15 -03:00
Matthias Clasen 6b83ded8f0 Merge branch 'harfbuzz-dep' into 'main'
build: Use a stable harfbuzz

See merge request GNOME/gtk!5327
2022-12-13 16:15:43 +00:00
Matthias Clasen cc23ef6eae build: Use a stable harfbuzz
We don't need the latest harfbuzz.
Stick to 4.0 for now.
2022-12-13 09:29:16 -05:00
Arjan Molenaar 089d0caa5e macos: Fix freeze on drag
A Drag surface does not have a parent surface. Therefore, if we initialize
it with one, it's inheriting the frame clock from the parent, but the
drag surface is not linked to the parent. Once the drag surface is destroyed,
it's disposing the frame clock, which results in a "frozen" application.
2022-12-13 15:19:04 +01:00
Arjan Molenaar d0c4413033 macos: Explicitly ungrab seat when drag is done or finalized
This is an extra safeguard that avoids grabbing resources longer than
nessecary. It also ensures the resource is removed from the drag,
so it is not freed again.
2022-12-13 15:19:04 +01:00
Arjan Molenaar 410fa9871f Remove old dragImage code
New code (macOS 10+ should support the NSDraggingSource protocol:
https://developer.apple.com/documentation/appkit/nsdraggingsource.
2022-12-13 15:19:04 +01:00
Matthias Clasen eba9c4e4c3 gtk-demo: Update the pickers demo 2022-12-13 07:49:10 -05:00
Matthias Clasen f94e9d26b5 gtk: Update all callers 2022-12-13 07:49:02 -05:00
Matthias Clasen 69cc4b42cf filelauncher: Add a file property 2022-12-13 07:48:35 -05:00
Matthias Clasen 66b4f2a9dd Merge branch 'docs/default-args' into 'main'
docs: Emphasize requirement to provide filenames as arguments

See merge request GNOME/gtk!5322
2022-12-13 12:17:07 +00:00
andy5995 99d6eb9cb4 docs: Emphasize requirement to give filenames as arguments
(related to #5430)
2022-12-12 23:40:07 -06:00
Matthias Clasen 631b0fa9fd Merge branch 'sunflowerskater-main-patch-64457' into 'main'
appchooser: Rename "application" to "app"

See merge request GNOME/gtk!5323
2022-12-12 16:48:56 +00:00
sunflowerskater e319b14dc2 appchooserbutton: Rename "application" to "app"
This change is a part of an initiative to use the word "app" instead of "application" in the UI:

Teams/Design/initiatives#123
2022-12-11 19:20:12 -03:00
sunflowerskater c96fefd7f5 appchooserwidget: Rename "application" to "app"
This change is a part of an initiative to use the word "app" instead of "application" in the UI:

https://gitlab.gnome.org/Teams/Design/initiatives/-/issues/123
2022-12-11 19:13:51 -03:00
sunflowerskater b1a9afbdba appchooser: Rename "application" to "app"
This change is a part of an initiative to use the word "app" instead of "application" in the UI: https://gitlab.gnome.org/Teams/Design/initiatives/-/issues/123
2022-12-11 20:05:54 +00:00
Matthias Clasen 6bed0cfb5a Merge branch 'popover-present-docs' into 'main'
popover: Clarify docs

See merge request GNOME/gtk!5318
2022-12-11 04:03:10 +00:00
Matthias Clasen 973a8752ab Merge branch 'ebassi/image-dispose' into 'main'
Do not change the notification queue inside finalization

Closes #5420

See merge request GNOME/gtk!5321
2022-12-11 04:02:49 +00:00
Matthias Clasen db3b216ad1 Merge branch 'builder-scope-note' into 'main'
builderscope: Add a note for implementors

See merge request GNOME/gtk!5317
2022-12-11 01:07:21 +00:00
Emmanuele Bassi b3b5a5064e Do not change the notification queue inside finalization
Notifications are not going to be emitted during the finalization, and
GObject will warn if you try to acquire and release a reference to the
notification queue when the reference count of an object has reached
zero.

Fixes: #5420
2022-12-11 00:36:03 +00:00
andy5995 9fd4b215ee docs: Place example-{3,4} in numerical order 2022-12-10 17:39:09 -06:00
Matthias Clasen 5c70f2ae9b builderscope: Add a note for implementors
Recommend that scope implementations should fall
back to or derive from GtkBuilderCScope in order
to not lose GTK's type-guessing machinery.

Related: #5398
2022-12-10 17:12:02 -05:00
Matthias Clasen 5df9f4016e popover: Clarify docs
gtk_popover_present() is a misleadingly named
function, so at least give it clear docs that
tell people to use gtk_popover_popup() instead.
2022-12-10 16:36:00 -05:00
Matthias Clasen 6f7a4b67c2 Merge branch 'docs/deprecated-G_APPLICATION_FLAGS_NONE' into 'main'
docs: Update deprecated G_APPLICATION_FLAGS_NONE in examples

See merge request GNOME/gtk!5315
2022-12-10 20:53:09 +00:00
andy5995 6e7ecb02f1 docs: Update deprecated G_APPLICATION_FLAGS_NONE 2022-12-10 01:12:13 -06:00
Matthias Clasen 146cf0bdd4 Merge branch 'deprecate-keys-changed' into 'main'
treeview: Drop a few unused variables

See merge request GNOME/gtk!5314
2022-12-09 19:03:01 +00:00
Matthias Clasen 00bdad23b0 Deprecate gtk_show_uri
This API has been superseded by GtkFileLauncher.
2022-12-09 13:36:28 -05:00
Matthias Clasen 8ff3217712 gtk: Stop using gtk_show_uri
Replace all uses of gtk_show_uri
with GtkFileLauncher.
2022-12-09 13:36:28 -05:00
Matthias Clasen 7a50e31b8d gtk-demo: Add a GtkFileLauncher demo
Replace the deprecated app chooser button by a
button that calls gtk_file_launcher_launch.
2022-12-09 13:25:02 -05:00
Matthias Clasen 1d9ee050f4 Add GtkFileLauncher
This is a replacement for gtk_show_uri_full,
which can open a GFile in an application, or
open its containing folder in a file manager.
2022-12-09 13:25:02 -05:00
Matthias Clasen 40d54ad3eb window: Deprecate the ::keys-changed signal 2022-12-09 13:14:27 -05:00
Matthias Clasen a9b387b37b tests: Silence a compiler warning 2022-12-09 13:13:24 -05:00
Matthias Clasen 12f9883599 treeview: Drop a few unused variables
Compilers get pickier every year...
2022-12-09 13:12:47 -05:00
Matthias Clasen 4e23fe896e composetable: Drop an unused variable 2022-12-09 13:09:34 -05:00
Olga Smirnova 0effe1fd07 Add Interlingue translation 2022-12-09 17:24:41 +00:00
Matthias Clasen a07bf1a047 Merge branch 'dialog-fixes' into 'main'
filechooserwidget: Fixes

See merge request GNOME/gtk!5311
2022-12-09 16:22:00 +00:00
Matthias Clasen 42cd230d44 openuriportal: Better error handling
Nested async calls are always a challenge.

Hopefully, things are straightened out now,
and we report GTK_DIALOG_ERROR errors for
the cases we care about.
2022-12-09 11:05:48 -05:00
Matthias Clasen bc8e19fcd0 openuriportal: Add a check function
Add private API to check whether the portal
is available.
2022-12-09 11:05:48 -05:00
Matthias Clasen ae29fee903 openuriportal: Support OpenDirectory
This required an extra argument. Update all callers.
2022-12-09 11:05:48 -05:00
Matthias Clasen 7ad0bae12f openuriportal: Cosmetics
There were some copy-paste errors.
2022-12-09 11:05:48 -05:00
Matthias Clasen 3e11ea9ddf fontdialog: Improve docs
Be more specific about possible errors.
2022-12-09 11:05:48 -05:00
Matthias Clasen 5b6c98d589 colordialog: Improve the docs
Be more specific about possible errors.
2022-12-09 11:05:48 -05:00
Matthias Clasen 57082e2e40 fontdialog: Don't forget to propagate errors
Oops.
2022-12-09 11:05:48 -05:00
Matthias Clasen 45e3e1594f fontdialogbutton: Survive window closing
If the parent window of the button gets destroyed
while the dialog is open, we cancel the async op,
but we need to be a little more careful about not
stepping on glass.
2022-12-09 11:05:48 -05:00
Matthias Clasen 637ef84d04 colordialogbutton: Survive window closing
If the parent window of the button gets destroyed
while the dialog is open, we cancel the async op,
but we need to be a little more careful about not
stepping on glass.
2022-12-09 11:05:48 -05:00
Matthias Clasen b297baed32 fontdialog: Unset check cancellable 2022-12-09 11:05:48 -05:00
Matthias Clasen c45f172e79 colordialog: Unset check cancellable 2022-12-09 11:05:48 -05:00
Matthias Clasen 417382375b filedialog: Report cancellation propertly
Unless we prevent it, GTask will always report
cancellation as G_IO_ERROR_CANCELLED. But we
want GTK_DIALOG_ERROR_ABORTED for this case.
2022-12-09 11:05:48 -05:00
Matthias Clasen 2e90a752eb filechooserwidget: Fixes
Fix a memory leak in the file manager launch path.
2022-12-09 11:05:48 -05:00
Matthias Clasen abe5181b10 Merge branch 'wip/corey/column-view-header' into 'main'
columnviewtitle: Prevent header clicks from propagating

Closes #5425

See merge request GNOME/gtk!5306
2022-12-09 15:28:58 +00:00
Matthias Clasen 585b6a3637 Merge branch 'matthiasc/node-editor-srcdir' into 'main'
node-editor: Redo saving location

Closes #5403

See merge request GNOME/gtk!5310
2022-12-09 15:22:00 +00:00
Matthias Clasen 3007b0fd7f Remove leftover debug spew 2022-12-09 10:04:42 -05:00
Matthias Clasen 96b9ac84f8 node-editor: Redo saving location
Determine the location to save testcases in dynamically,
trying first a GTK_SOURCE_DIR environment variable
and then the current directory as the GTK source dir,
ultimatively falling back to just saving in the current
directory.

This avoids leaking details of the build environment
into the produced artifacts and should make GTK builds
more reproducible.

Fixes: #5403
2022-12-09 09:35:32 -05:00
Matthias Clasen 860c2f8ddd Merge branch 'fix-file-dialog-title' into 'main'
filedialog: Use title if set

Closes #5415

See merge request GNOME/gtk!5308
2022-12-08 13:16:55 +00:00
Matthias Clasen de83d57e14 filedialog: Use title if set
This broken when the code was reshuffled into
the switch.

Fixes: #5415
2022-12-08 07:57:16 -05:00
Matthias Clasen 9de963e8b4 Merge branch 'wip/carlosg/stale-timeout' into 'main'
gdk/x11: Clear all data in GdkSurfaceX11 finalization

See merge request GNOME/gtk!5303
2022-12-08 12:18:37 +00:00
Matthias Clasen 5e92c26b9a Merge branch 'macos-unused-vars' into 'main'
macos: remove unused variables from macos code

See merge request GNOME/gtk!5290
2022-12-08 12:17:13 +00:00
Matthias Clasen 8c7b9c30de Merge branch 'ccook/spelling-changes' into 'main'
Various spelling mistakes across a few domains that show up in documentation.

See merge request GNOME/gtk!5292
2022-12-08 12:16:22 +00:00
Cam Cook 6bfb35f047 Various spelling mistakes across a few domains that show up in documentation. 2022-12-08 12:16:22 +00:00
Matthias Clasen 53c3cce5e4 Merge branch 'emoji-recent-empty' into 'main'
emojichooser: Actually disable the recent section

See merge request GNOME/gtk!5305
2022-12-08 12:09:26 +00:00
Luca Bacci acd7d739f5 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-08 11:41:05 +01:00
Corey Berla 33e7774743 columnviewtitle: Prevent header clicks from propagating
The header in GtkColumnView has multiple event handlers
there is a ::pressed handler in GtkColumnView for
resizing the columns in CAPTURE as well as a motion
and drag controller.  The ::release handler is in
GtkColumnViewTitle.   We can't claim the event in the
existing handlers because then the ::release handler will
never get called.  Currently, however, all clicks get propagated
to the ColumnView from the header which can be problematic.
Since we don't usually want the clicks from the header
handled on the view, claim it in the BUBBLE phase.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5425
2022-12-07 10:25:09 -10:00
Guido Günther 89c816a614 emojichooser: Actually disable the recent section
The loop sets empty = FALSE when there are emojis but for that
to work we need to initialize the value to TRUE initially.

Fixes: 7928532bc5
2022-12-07 19:33:59 +01:00
Carlos Garnacho c24358cfbc 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-07 13:16:36 +01:00
Arjan Molenaar 19aaa8fee5 macos: Use Command key symbol for meta
Show the Apple Command symbol ⌘ as keyboard shortcut for the Meta key on macos,
similar to GtkAccelGroup.
2022-12-05 21:00:42 +01:00
Joan Bruguera 43c1a433aa gdk/wayland: set requesting surface to xdg-activation
The argument to xdg_activation_token_v1_set_surface is documented to be the
surface requesting the activation, not the surface to be activated, which is
given later when calling xdg_activation_v1_activate.
(c.f. https://gitlab.freedesktop.org/wayland/wayland-protocols/-/commit/36cee4bdbcaf3a75f567315809953b5e21d703da)

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

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

Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
2022-12-04 23:33:34 +00:00
Arjan Molenaar 097d87e502 Cleanup: remove unused variables from macos code
Remove unused variables. In case if Cairo code it would
allocate memory, which would result in a memory leak.
2022-12-04 12:50:20 +01:00
Corey Berla ff8d88b097 dragsource: Add a timeout before starting a drag
No one wants a drag that happens in less than 100ms (if so, it's
probably accidental).
2022-11-29 20:06:21 -08:00
Emmanuele Bassi cc546d7af1 build: Add a check argument to run_command()
Silence a Meson warning.
2022-11-26 15:18:42 +00:00
Emmanuele Bassi 03db707f3c vulkan: Add missing enumeration
Check for VK_ERROR_COMPRESSION_EXHAUSTED_EXT.
2022-11-26 15:18:42 +00:00
Emmanuele Bassi a8cd2750f7 ci: Download the subprojects
Updating the subprojects will apparently fail if they haven't been
downloaded.
2022-11-26 15:18:42 +00:00
Emmanuele Bassi ffad21a9d6 ci: Use Fedora 37 as the base
New stable release means new CI failures.
2022-11-26 14:04:07 +00:00
Emmanuele Bassi 5419f1f2f0 ci: Update the gi-docgen dependencies
The python3-toml package is deprecated, and replaced by python3-tomli.
At least, until we bump up the dependency to Fedora 37: then we can
depend on Python 3.11, and its TOML parser in the standard library.

See also: https://gitlab.gnome.org/GNOME/gi-docgen/-/merge_requests/168
2022-11-25 17:50:21 +00:00
Florian "sp1rit"​ 6dd939f13e improved docs of Gtk.GestureStylus 2022-11-23 09:09:50 +01:00
Florian "sp1rit"​ c85fbcea55 adjusted stylus-only code to fit gtk code conventions 2022-11-23 08:59:29 +01:00
Florian "sp1rit"​ 789778105d gtk: gtkgesturestylus: implemented stylus-only property
this allows setting a Gtk.GestureStylus to a state, where it can be
used to handle non-stylus devices (e.g. mice).
This might be useful for applications that handle stylus input, but
want to allow falling back to a mice, if the user is unable to provide
stylus input.
2022-11-22 09:13:35 +01:00
Florian "sp1rit"​ c36685bf60 gdk: gdkevents: added NULL check to gdk_event_get_axes
this is to prevent gdk from causing a segfault, when getting event axes
for events that don't have them (i.e. attempting to get pressure from a
mice input device).
2022-11-22 09:13:32 +01:00
Luca Bacci 26c524a578 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:27:24 +01:00
Hodong 30525835f3 Fix a typo 2022-10-25 19:40:30 +00:00
Ondřej Míchal 818ca63d35 gdkdisplay: Document get_monitor_at_surface can return NULL
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5075
2022-08-01 12:54:13 +02:00
Jens Georg b9551a8952 Remove obsolete "or %NULL" documentation 2022-04-20 15:15:51 +02:00
Jens Georg e600fcbcc5 widget: Mark format as nullable in activate_action
The doc and the code allow it to be NULL
2022-04-19 10:17:39 +02:00
379 changed files with 27655 additions and 13610 deletions
+76 -51
View File
@@ -22,11 +22,11 @@ stages:
# Common variables
variables:
COMMON_MESON_FLAGS: "-Dwerror=true -Dglib:werror=false -Dpango:werror=false -Dgtk-doc:werror=false -Dwayland-protocols:werror=false -Dsysprof:werror=false -Dwayland:werror=false"
COMMON_MESON_FLAGS: "-Dwerror=true -Dcairo:werror=false -Dgi-docgen:werror=false -Dgraphene:werror=false -Dlibepoxy:werror=false -Dlibsass:werror=false -Dpango:werror=false -Dsassc:werror=false -Dgdk-pixbuf:werror=false -Dglib:werror=false -Dlibcloudproviders:werror=false -Dlibpng:werror=false -Dlibtiff:werror=false -Dsysprof:werror=false -Dwayland-protocols:werror=false -Dharfbuzz:werror=false -Dfreetype2:werror=false -Dfontconfig:werror=false -Dfribidi:werror=false -Dlibffi:werror=false -Dlibjpeg-turbo:werror=false -Dmutest:werror=false -Dpixman:werror=false -Dproxy-libintl:werror=false"
BACKEND_FLAGS: "-Dx11-backend=true -Dwayland-backend=true -Dbroadway-backend=true"
FEATURE_FLAGS: "-Dvulkan=enabled -Dcloudproviders=enabled"
FEATURE_FLAGS: "-Dvulkan=enabled -Dcloudproviders=enabled -Ddemos=false -Dbuild-examples=false -Dbuild-tests=false -Dbuild-testsuite=true"
MESON_TEST_TIMEOUT_MULTIPLIER: 3
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v38"
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v40"
FLATPAK_IMAGE: "quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master"
.only-default:
@@ -71,11 +71,6 @@ style-check-diff:
key: "$CI_JOB_NAME"
paths:
- _ccache/
- subprojects/gdk-pixbuf/
- subprojects/glib/
- subprojects/graphene/
- subprojects/libepoxy/
- subprojects/pango/
fedora-x86_64:
extends: .build-fedora-default
@@ -85,10 +80,17 @@ fedora-x86_64:
EXTRA_MESON_FLAGS: "--buildtype=debug --default-library=both"
script:
- .gitlab-ci/show-info-linux.sh
- meson subprojects update
- export PATH="$HOME/.local/bin:$PATH"
- pip3 install --user meson~=0.64
- meson subprojects download
- meson subprojects update --reset
- mkdir _install
- meson --prefix=${CI_PROJECT_DIR}/_install
${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
- meson setup
--prefix=${CI_PROJECT_DIR}/_install
${COMMON_MESON_FLAGS}
${EXTRA_MESON_FLAGS}
${BACKEND_FLAGS}
${FEATURE_FLAGS}
_build
- meson compile -C _build
- meson install -C _build
@@ -107,10 +109,17 @@ release-build:
EXTRA_MESON_FLAGS: "--buildtype=release"
script:
- .gitlab-ci/show-info-linux.sh
- meson subprojects update
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
- export PATH="$HOME/.local/bin:$PATH"
- pip3 install --user meson~=0.64
- meson subprojects download
- meson subprojects update --reset
- meson setup
${COMMON_MESON_FLAGS}
${EXTRA_MESON_FLAGS}
${BACKEND_FLAGS}
${FEATURE_FLAGS}
_build
- ninja -C _build
- meson compile -C _build
- .gitlab-ci/run-tests.sh _build x11
fedora-mingw64:
@@ -131,34 +140,24 @@ fedora-mingw64:
# mingw64-graphene (rawhide)
script:
- .gitlab-ci/show-info-linux.sh
- meson subprojects update
- mkdir _build && cd _build
- mingw64-meson -Dintrospection=disabled -Dgraphene:introspection=disabled
- ninja
installed-tests:
extends: .build-fedora-default
stage: build
needs: []
variables:
EXTRA_MESON_FLAGS: "--prefix=/usr --libdir=/usr/lib64 -Dinstall-tests=true"
G_TEST_ACCESSIBLE: 1
script:
- .gitlab-ci/show-info-linux.sh
- meson subprojects update
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
_build
- export PATH="$HOME/.local/bin:$PATH"
- pip3 install --user meson~=0.64
- meson subprojects download
- meson subprojects update --reset
# Test that mingw64-meson still fails. If it has stopped failing, the CI
# will fail and now you should remove the hack that follows this.
- FAILED=false
- mingw64-meson --version || FAILED=true
- test $FAILED = false && echo "mingw64-meson works now, remove the hack" && exit 1
# HACK: Running mingw64-meson directly fails on the CI with:
# /usr/bin/mingw64-meson: line 92: fg: no job control
# Because rpm is not evaluating %__meson and it gets interpreted as a job
# specifier. So we fix that and run it ourselves.
- rpm --eval "%{mingw64_meson}" > mingw64-meson.sh
- sed -i -e 's/%__meson/meson/' mingw64-meson.sh
- chmod +x mingw64-meson.sh
- ./mingw64-meson.sh -Dintrospection=disabled -Dgraphene:introspection=disabled _build
- ninja -C _build
- sudo ninja -C _build install
- dbus-run-session xvfb-run -a -s "-screen 0 1024x768x24"
gnome-desktop-testing-runner
--report-directory=_build/installed-tests-report/failed/
--parallel=0
gtk-4.0
artifacts:
paths:
- "_build/installed-tests-report/"
.mingw-defaults:
extends: .only-default
@@ -191,6 +190,8 @@ msys2-mingw64:
- "${CI_PROJECT_DIR}/_build/gtkdll.tar.gz"
macos:
# Sadly, this fails regularly, and its failure is never enlightening
allow_failure: true
extends: .only-default
only:
- branches@GNOME/gtk
@@ -200,12 +201,13 @@ 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
script:
- meson -Dx11-backend=false
- meson setup ${COMMON_MESON_FLAGS}
-Dx11-backend=false
-Dbroadway-backend=true
-Dmacos-backend=true
-Dmedia-gstreamer=disabled
@@ -213,8 +215,12 @@ macos:
-Dcpp_std=c++11
-Dpixman:tests=disabled
-Dlibjpeg-turbo:simd=disabled
-Ddemos=false
-Dbuild-tests=false
-Dbuild-examples=false
-Dbuild-testsuite=false
_build
- ninja -C _build
- meson compile -C _build
artifacts:
when: always
paths:
@@ -339,15 +345,20 @@ static-scan:
variables:
EXTRA_MESON_FLAGS: "--buildtype=debug"
script:
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} _scan_build
- export PATH="$HOME/.local/bin:$PATH"
- pip3 install --user meson~=0.64
- meson setup
${COMMON_MESON_FLAGS}
${EXTRA_MESON_FLAGS}
_scan_build
- ninja -C _scan_build scan-build
artifacts:
paths:
- _scan_build/meson-logs
allow_failure: true
# Run tests with the address sanitizer. We need to turn off introspection,
# since it is incompatible with asan
# Run tests with the address sanitizer. We need to turn off introspection
# and f16c, since they are incompatible with asan
asan-build:
image: $FEDORA_IMAGE
tags: [ asan ]
@@ -355,7 +366,9 @@ asan-build:
needs: []
variables:
script:
- CC=clang meson --buildtype=debugoptimized -Db_sanitize=address -Db_lundef=false -Dintrospection=disabled _build
- export PATH="$HOME/.local/bin:$PATH"
- pip3 install --user meson~=0.64
- CC=clang meson setup --buildtype=debugoptimized -Db_sanitize=address -Db_lundef=false -Dintrospection=disabled -Df16c=disabled _build
- ninja -C _build
- .gitlab-ci/run-tests.sh _build wayland
artifacts:
@@ -367,10 +380,22 @@ reference:
image: $FEDORA_IMAGE
stage: docs
needs: []
variables:
EXTRA_MESON_FLAGS: "--buildtype=release --force-fallback-for=gdk-pixbuf,pango"
script:
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} -Dgtk_doc=true -Dgdk-pixbuf:gtk_doc=true -Dpango:gtk_doc=true _build
- export PATH="$HOME/.local/bin:$PATH"
- pip3 install --user meson~=0.64
- meson setup
${COMMON_MESON_FLAGS}
--buildtype=release
--force-fallback-for=gdk-pixbuf,pango
-Dintrospection=enabled
-Dgtk_doc=true
-Dgdk-pixbuf:gtk_doc=true
-Dpango:gtk_doc=true
-Ddemos=false
-Dbuild-examples=false
-Dbuild-tests=false
-Dbuild-testsuite=false
_build
- meson compile -C _build
- mkdir -p _reference/
- mv _build/docs/reference/gdk/gdk4/ _reference/gdk4/
+4 -5
View File
@@ -1,4 +1,4 @@
FROM fedora:36
FROM fedora:37
RUN dnf -y install \
adwaita-icon-theme \
@@ -18,7 +18,9 @@ RUN dnf -y install \
dejavu-sans-mono-fonts \
desktop-file-utils \
diffutils \
docbook-style-xsl \
elfutils-libelf-devel \
expat-devel \
fribidi-devel \
gcc \
gcc-c++ \
@@ -31,6 +33,7 @@ RUN dnf -y install \
glibc-devel \
glibc-headers \
gnome-desktop-testing \
gnupg2 \
gobject-introspection-devel \
graphene-devel \
graphviz \
@@ -70,7 +73,6 @@ RUN dnf -y install \
mesa-dri-drivers \
mesa-libEGL-devel \
mesa-libGLES-devel \
meson \
ninja-build \
pango-devel \
pcre-devel \
@@ -82,7 +84,6 @@ RUN dnf -y install \
python3-markdown \
python3-pip \
python3-pygments \
python3-toml \
python3-typogrify \
python3-wheel \
redhat-rpm-config \
@@ -94,8 +95,6 @@ RUN dnf -y install \
weston-libs \
which \
xorg-x11-server-Xvfb \
&& dnf install -y 'dnf-command(builddep)' \
&& dnf builddep -y wayland \
&& dnf clean all
# Enable sudo for wheel users
+1 -1
View File
@@ -8,7 +8,7 @@ builddir=$1
backend=$2
# Ignore memory leaks lower in dependencies
export LSAN_OPTIONS=suppressions=$srcdir/lsan.supp:print_suppressions=0
export LSAN_OPTIONS=suppressions=$srcdir/lsan.supp:print_suppressions=0:verbosity=1:log_threads=1
export G_SLICE=always-malloc
case "${backend}" in
+1 -1
View File
@@ -5,7 +5,7 @@ call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliar
@echo on
:: FIXME: make warnings fatal
pip3 install --upgrade --user meson==0.60.3 || goto :error
pip3 install --upgrade --user meson~=0.64 || goto :error
meson -Ddebug=false -Dmedia-gstreamer=disabled _build || goto :error
ninja -C _build || goto :error
+69 -1
View File
@@ -1,6 +1,74 @@
Overview of Changes in 4.9.2, xx-xx-xxxx
Overview of Changes in 4.9.3, xx-xx-xxxx
========================================
Overview of Changes in 4.9.2, 26-12-2022
========================================
* GtkFileChooserWidget:
- Add a grid view
* GtkText, GtkTextView:
- Fix activation of the on-screen keyboard
- Prevent unexpected text direction changes
* GtkCenterBox:
- Add properties for children
* GtkTreeExpander:
- Add a hide-expander property
* GtkStringList:
- Add a construct-only strings property
* GtkBuilder:
- Support parsing Pango attributes in string form
* GtkGestureStylus:
- Add a stylus-only property
* GtkFileLauncher:
- New async-style api to replace gtk_show_uri
* GtkColorDialog, GtkFontDialog, GtkFileDialog,
GtkAlertDialog:
- APIs have seen some tweaks
- Prefer portals when available
- Fixes for cancellation
* Add GDK_DEBUG=no-portals
* Improve file DND with remote files
* GtkInfoBar has been deprecated
* gtk_widget_show/hide have been deprecated
* gtk_show_uri has been deprecated
* Wayland:
- Fix button mask handling
- Fix problems with cursor size on hi-dpi screens
- Support newer versions of some protocols
- Fix handling of surrounding text in input methods
* X11:
- Fix some ordering problems with surface destruction
* Windows:
- Improved system settings integration
- Fix window resizing work with native decorations
- Include a full hicolor index.theme file as a resource
* Translation updates
Croatian
Dutch
Hungarian
Interlingua
Persian
Turkish
Ukrainian
Overview of Changes in 4.9.1, 31-10-2022
========================================
@@ -228,9 +228,9 @@ open_cb (GtkWidget *button,
dialog = gtk_file_dialog_new ();
gtk_file_dialog_set_title (dialog, "Open file");
cwd = g_file_new_for_path (".");
gtk_file_dialog_set_current_folder (dialog, cwd);
gtk_file_dialog_set_initial_folder (dialog, cwd);
g_object_unref (cwd);
gtk_file_dialog_open (dialog, GTK_WINDOW (self), NULL, NULL, open_response_cb, self);
gtk_file_dialog_open (dialog, GTK_WINDOW (self), NULL, open_response_cb, self);
g_object_unref (dialog);
}
@@ -337,11 +337,10 @@ save_cb (GtkWidget *button,
dialog = gtk_file_dialog_new ();
gtk_file_dialog_set_title (dialog, "Save constraints");
cwd = g_file_new_for_path (".");
gtk_file_dialog_set_current_folder (dialog, cwd);
gtk_file_dialog_set_initial_folder (dialog, cwd);
g_object_unref (cwd);
gtk_file_dialog_save (dialog,
GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (button))),
NULL, NULL,
NULL,
save_response_cb, self);
g_object_unref (dialog);
+1 -1
View File
@@ -124,7 +124,7 @@ activate_open (GSimpleAction *action,
GtkFileDialog *dialog;
dialog = gtk_file_dialog_new ();
gtk_file_dialog_open (dialog, NULL, NULL, NULL, open_response_cb, g_object_ref (app));
gtk_file_dialog_open (dialog, NULL, NULL, open_response_cb, g_object_ref (app));
g_object_unref (dialog);
}
+5 -2
View File
@@ -244,8 +244,9 @@ open_file_cb (GtkWidget *button)
gtk_file_dialog_open (dialog,
GTK_WINDOW (gtk_widget_get_ancestor (button, GTK_TYPE_WINDOW)),
NULL,
NULL,
file_chooser_response, button);
g_object_unref (dialog);
}
static void
@@ -277,9 +278,11 @@ open_folder_cb (GtkWidget *button)
gtk_file_dialog_select_folder (dialog,
GTK_WINDOW (gtk_widget_get_ancestor (button, GTK_TYPE_WINDOW)),
NULL,
NULL,
folder_chooser_response, button);
g_object_unref (dialog);
}
static void
update_paste_button_sensitivity (GdkClipboard *clipboard,
GtkWidget *paste_button)
-1
View File
@@ -167,7 +167,6 @@ file_open_cb (GtkWidget *button,
gtk_file_dialog_open (dialog,
GTK_WINDOW (gtk_widget_get_root (button)),
NULL,
NULL,
open_response_cb, stringlist);
g_object_unref (dialog);
}
+1 -1
View File
@@ -156,7 +156,7 @@ demos_h = custom_target('gtk4 demo header',
objcopy_supports_add_symbol = false
objcopy = find_program('objcopy', required : false)
if objcopy.found()
objcopy_supports_add_symbol = run_command(objcopy, '--help').stdout().contains('--add-symbol')
objcopy_supports_add_symbol = run_command(objcopy, '--help', check: false).stdout().contains('--add-symbol')
endif
ld = find_program('ld', required : false)
-1
View File
@@ -55,7 +55,6 @@ show_file_open (GtkWidget *button,
gtk_file_dialog_open (dialog,
GTK_WINDOW (gtk_widget_get_root (button)),
NULL,
NULL,
open_response_cb, picture);
}
+84 -18
View File
@@ -1,15 +1,17 @@
/* Pickers
* #Keywords: GtkColorDialog, GtkFontDialog, GtkFileDialog
/* Pickers and Launchers
* #Keywords: GtkColorDialog, GtkFontDialog, GtkFileDialog, GtkFileLauncher, GtkUriLauncher
*
* These widgets are mainly intended for use in preference dialogs.
* The dialogs are mainly intended for use in preference dialogs.
* They allow to select colors, fonts and applications.
*
* This demo shows both the default appearance for these dialogs,
* as well as some of the customizations that are possible.
* The launchers let you open files or URIs in applications that
* can handle them.
*/
#include <gtk/gtk.h>
static GtkWidget *app_picker;
static void
file_opened (GObject *source,
GAsyncResult *result,
@@ -25,12 +27,17 @@ file_opened (GObject *source,
{
g_print ("%s\n", error->message);
g_error_free (error);
gtk_widget_set_sensitive (app_picker, FALSE);
g_object_set_data (G_OBJECT (app_picker), "file", NULL);
return;
}
name = g_file_get_basename (file);
gtk_label_set_label (GTK_LABEL (data), name);
g_free (name);
gtk_widget_set_sensitive (app_picker, TRUE);
g_object_set_data_full (G_OBJECT (app_picker), "file", g_object_ref (file), g_object_unref);
}
static gboolean
@@ -59,12 +66,70 @@ open_file (GtkButton *picker,
20,
abort_mission, g_object_ref (cancellable), g_object_unref);
gtk_file_dialog_open (dialog, parent, NULL, cancellable, file_opened, label);
gtk_file_dialog_open (dialog, parent, cancellable, file_opened, label);
g_object_unref (cancellable);
g_object_unref (dialog);
}
static void
open_app_done (GObject *source,
GAsyncResult *result,
gpointer data)
{
GtkFileLauncher *launcher = GTK_FILE_LAUNCHER (source);
GError *error = NULL;
if (!gtk_file_launcher_launch_finish (launcher, result, &error))
{
g_print ("%s\n", error->message);
g_error_free (error);
}
}
static void
open_app (GtkButton *picker)
{
GtkWindow *parent = GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (picker)));
GtkFileLauncher *launcher;
GFile *file;
file = G_FILE (g_object_get_data (G_OBJECT (picker), "file"));
launcher = gtk_file_launcher_new (file);
gtk_file_launcher_launch (launcher, parent, NULL, open_app_done, NULL);
g_object_unref (launcher);
}
static void
open_uri_done (GObject *source,
GAsyncResult *result,
gpointer data)
{
GtkUriLauncher *launcher = GTK_URI_LAUNCHER (source);
GError *error = NULL;
if (!gtk_uri_launcher_launch_finish (launcher, result, &error))
{
g_print ("%s\n", error->message);
g_error_free (error);
}
}
static void
launch_uri (GtkButton *picker)
{
GtkWindow *parent = GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (picker)));
GtkUriLauncher *launcher;
launcher = gtk_uri_launcher_new ("http://www.gtk.org");
gtk_uri_launcher_launch (launcher, parent, NULL, open_uri_done, NULL);
g_object_unref (launcher);
}
GtkWidget *
do_pickers (GtkWidget *do_widget)
{
@@ -76,7 +141,7 @@ do_pickers (GtkWidget *do_widget)
window = gtk_window_new ();
gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Pickers");
gtk_window_set_title (GTK_WINDOW (window), "Pickers and Launchers");
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
table = gtk_grid_new ();
@@ -84,8 +149,8 @@ do_pickers (GtkWidget *do_widget)
gtk_widget_set_margin_end (table, 20);
gtk_widget_set_margin_top (table, 20);
gtk_widget_set_margin_bottom (table, 20);
gtk_grid_set_row_spacing (GTK_GRID (table), 3);
gtk_grid_set_column_spacing (GTK_GRID (table), 10);
gtk_grid_set_row_spacing (GTK_GRID (table), 6);
gtk_grid_set_column_spacing (GTK_GRID (table), 6);
gtk_window_set_child (GTK_WINDOW (window), table);
label = gtk_label_new ("Color:");
@@ -112,7 +177,7 @@ do_pickers (GtkWidget *do_widget)
gtk_widget_set_hexpand (label, TRUE);
gtk_grid_attach (GTK_GRID (table), label, 0, 2, 1, 1);
picker = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
picker = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
button = gtk_button_new_from_icon_name ("document-open-symbolic");
label = gtk_label_new ("None");
gtk_label_set_xalign (GTK_LABEL (label), 0.);
@@ -121,21 +186,22 @@ do_pickers (GtkWidget *do_widget)
g_signal_connect (button, "clicked", G_CALLBACK (open_file), label);
gtk_box_append (GTK_BOX (picker), label);
gtk_box_append (GTK_BOX (picker), button);
app_picker = gtk_button_new_from_icon_name ("emblem-system-symbolic");
gtk_widget_set_halign (app_picker, GTK_ALIGN_END);
gtk_widget_set_sensitive (app_picker, FALSE);
g_signal_connect (app_picker, "clicked", G_CALLBACK (open_app), NULL);
gtk_box_append (GTK_BOX (picker), app_picker);
gtk_grid_attach (GTK_GRID (table), picker, 1, 2, 1, 1);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
label = gtk_label_new ("Mail:");
label = gtk_label_new ("URI:");
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
gtk_widget_set_hexpand (label, TRUE);
picker = gtk_app_chooser_button_new ("x-scheme-handler/mailto");
gtk_app_chooser_button_set_show_dialog_item (GTK_APP_CHOOSER_BUTTON (picker), TRUE);
G_GNUC_END_IGNORE_DEPRECATIONS
gtk_grid_attach (GTK_GRID (table), label, 0, 3, 1, 1);
picker = gtk_button_new_with_label ("www.gtk.org");
g_signal_connect (picker, "clicked", G_CALLBACK (launch_uri), NULL);
gtk_grid_attach (GTK_GRID (table), picker, 1, 3, 1, 1);
}
+1 -2
View File
@@ -56,7 +56,7 @@ open_clicked_cb (GtkWidget *button,
gtk_file_filter_set_name (filter, "Video");
g_list_store_append (filters, filter);
gtk_file_dialog_set_current_filter (dialog, filter);
gtk_file_dialog_set_default_filter (dialog, filter);
g_object_unref (filter);
gtk_file_dialog_set_filters (dialog, G_LIST_MODEL (filters));
@@ -65,7 +65,6 @@ open_clicked_cb (GtkWidget *button,
gtk_file_dialog_open (dialog,
GTK_WINDOW (gtk_widget_get_root (button)),
NULL,
NULL,
open_dialog_response_cb, video);
}
+1 -3
View File
@@ -14,9 +14,7 @@ executable('gtk4-node-editor',
sources: [node_editor_sources, node_editor_resources],
dependencies: [ libgtk_dep, demo_conf_h ],
include_directories: confinc,
c_args: [
'-DNODE_EDITOR_SOURCE_DIR="@0@/../../testsuite/gsk/compare/"'.format(meson.current_source_dir())
] + common_cflags,
c_args: common_cflags,
win_subsystem: 'windows',
link_args: extra_demo_ldflags,
install: true,
+48 -12
View File
@@ -32,10 +32,6 @@
#include "gsk/vulkan/gskvulkanrenderer.h"
#endif
#ifndef NODE_EDITOR_SOURCE_DIR
#define NODE_EDITOR_SOURCE_DIR "." /* Fallback */
#endif
typedef struct
{
gsize start_chars;
@@ -573,10 +569,10 @@ show_open_filechooser (NodeEditorWindow *self)
dialog = gtk_file_dialog_new ();
gtk_file_dialog_set_title (dialog, "Open node file");
cwd = g_file_new_for_path (".");
gtk_file_dialog_set_current_folder (dialog, cwd);
gtk_file_dialog_set_initial_folder (dialog, cwd);
g_object_unref (cwd);
gtk_file_dialog_open (dialog, GTK_WINDOW (self),
NULL, NULL, open_response_cb, self);
NULL, open_response_cb, self);
g_object_unref (dialog);
}
@@ -637,13 +633,12 @@ save_cb (GtkWidget *button,
dialog = gtk_file_dialog_new ();
gtk_file_dialog_set_title (dialog, "Save node");
cwd = g_file_new_for_path (".");
gtk_file_dialog_set_current_folder (dialog, cwd);
gtk_file_dialog_set_initial_folder (dialog, cwd);
gtk_file_dialog_set_initial_name (dialog, "demo.node");
g_object_unref (cwd);
gtk_file_dialog_save (dialog,
GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (button))),
NULL,
"demo.node",
NULL,
save_response_cb, self);
g_object_unref (dialog);
}
@@ -746,11 +741,10 @@ export_image_cb (GtkWidget *button,
dialog = gtk_file_dialog_new ();
gtk_file_dialog_set_title (dialog, "");
gtk_file_dialog_set_initial_name (dialog, "example.png");
gtk_file_dialog_save (dialog,
GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (button))),
NULL,
"example.png",
NULL,
export_image_response_cb, texture);
g_object_unref (dialog);
}
@@ -788,12 +782,52 @@ testcase_name_entry_changed_cb (GtkWidget *button,
gtk_widget_set_sensitive (self->testcase_save_button, FALSE);
}
/* Returns the location where gsk test cases are stored in
* the GTK testsuite, if we can determine it.
*
* When running node editor outside of a GTK build, you can
* set GTK_SOURCE_DIR to point it at the checkout.
*/
static char *
get_source_dir (void)
{
const char *subdir = "testsuite/gsk/compare";
const char *source_dir;
char *current_dir;
char *dir;
source_dir = g_getenv ("GTK_SOURCE_DIR");
current_dir = g_get_current_dir ();
if (source_dir)
{
char *abs_source_dir = g_canonicalize_filename (source_dir, NULL);
dir = g_canonicalize_filename (subdir, abs_source_dir);
g_free (abs_source_dir);
}
else
{
dir = g_canonicalize_filename (subdir, current_dir);
}
if (g_file_test (dir, G_FILE_TEST_EXISTS))
{
g_free (current_dir);
return dir;
}
g_free (dir);
return current_dir;
}
static void
testcase_save_clicked_cb (GtkWidget *button,
NodeEditorWindow *self)
{
const char *testcase_name = gtk_editable_get_text (GTK_EDITABLE (self->testcase_name_entry));
char *source_dir = g_canonicalize_filename (NODE_EDITOR_SOURCE_DIR, NULL);
char *source_dir = get_source_dir ();
char *node_file_name;
char *node_file;
char *png_file_name;
@@ -806,6 +840,8 @@ testcase_save_clicked_cb (GtkWidget *button,
node_file = g_build_filename (source_dir, node_file_name, NULL);
g_free (node_file_name);
g_debug ("Saving testcase in %s", node_file);
png_file_name = g_strconcat (testcase_name, ".png", NULL);
png_file = g_build_filename (source_dir, png_file_name, NULL);
g_free (png_file_name);
-3
View File
@@ -508,8 +508,6 @@ activate_save_as (GSimpleAction *action,
gtk_file_dialog_save (dialog,
GTK_WINDOW (main_window),
NULL,
NULL,
NULL,
on_save_response, NULL);
g_object_unref (dialog);
}
@@ -553,7 +551,6 @@ activate_open (GSimpleAction *action,
gtk_file_dialog_open (dialog,
GTK_WINDOW (main_window),
NULL,
NULL,
on_open_response, NULL);
g_object_unref (dialog);
}
+1 -1
View File
@@ -3,7 +3,7 @@
objcopy_supports_add_symbol = false
objcopy = find_program('objcopy', required : false)
if objcopy.found()
objcopy_supports_add_symbol = run_command(objcopy, '--help').stdout().contains('--add-symbol')
objcopy_supports_add_symbol = run_command(objcopy, '--help', check: false).stdout().contains('--add-symbol')
endif
ld = find_program('ld', required : false)
+69 -1
View File
@@ -237,7 +237,7 @@ activate_open_file (GSimpleAction *action,
GtkFileDialog *dialog;
dialog = gtk_file_dialog_new ();
gtk_file_dialog_open (dialog, NULL, NULL, NULL, file_chooser_response, NULL);
gtk_file_dialog_open (dialog, NULL, NULL, file_chooser_response, NULL);
g_object_unref (dialog);
}
@@ -2056,6 +2056,67 @@ hide_widget (GtkWidget *widget)
gtk_widget_set_visible (widget, FALSE);
}
static void
load_texture_thread (GTask *task,
gpointer source_object,
gpointer task_data,
GCancellable *cancellable)
{
const char *resource_path = (const char *) task_data;
GBytes *bytes;
GdkTexture *texture;
GError *error = NULL;
bytes = g_resources_lookup_data (resource_path, 0, &error);
if (!bytes)
{
g_task_return_error (task, error);
return;
}
texture = gdk_texture_new_from_bytes (bytes, &error);
g_bytes_unref (bytes);
if (!texture)
{
g_task_return_error (task, error);
return;
}
g_task_return_pointer (task, texture, g_object_unref);
}
static void
load_texture_done (GObject *source,
GAsyncResult *result,
gpointer data)
{
GtkWidget *picture = GTK_WIDGET (source);
GdkTexture *texture;
GError *error = NULL;
texture = g_task_propagate_pointer (G_TASK (result), &error);
if (!texture)
{
g_warning ("%s", error->message);
g_error_free (error);
return;
}
gtk_picture_set_paintable (GTK_PICTURE (picture), GDK_PAINTABLE (texture));
g_object_unref (texture);
}
static void
load_texture_in_thread (GtkWidget *picture,
const char *resource_path)
{
GTask *task = g_task_new (picture, NULL, load_texture_done, NULL);
g_task_set_task_data (task, (gpointer)resource_path, NULL);
g_task_run_in_thread (task, load_texture_thread);
g_object_unref (task);
}
static void
activate (GApplication *app)
{
@@ -2155,6 +2216,13 @@ activate (GApplication *app)
window = (GtkWindow *)gtk_builder_get_object (builder, "window");
load_texture_in_thread ((GtkWidget *)gtk_builder_get_object (builder, "notebook_sunset"),
"/org/gtk/WidgetFactory4/sunset.jpg");
load_texture_in_thread ((GtkWidget *)gtk_builder_get_object (builder, "notebook_nyc"),
"/org/gtk/WidgetFactory4/nyc.jpg");
load_texture_in_thread ((GtkWidget *)gtk_builder_get_object (builder, "notebook_beach"),
"/org/gtk/WidgetFactory4/beach.jpg");
if (g_strcmp0 (PROFILE, "devel") == 0)
gtk_widget_add_css_class (GTK_WIDGET (window), "devel");
+3 -6
View File
@@ -1263,8 +1263,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<child>
<object class="GtkNotebookPage">
<property name="child">
<object class="GtkPicture">
<property name="file">resource:///org/gtk/WidgetFactory4/sunset.jpg</property>
<object class="GtkPicture" id="notebook_sunset">
<property name="content-fit">cover</property>
<child>
<object class="GtkDragSource">
@@ -1290,8 +1289,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<child>
<object class="GtkNotebookPage">
<property name="child">
<object class="GtkPicture">
<property name="file">resource:///org/gtk/WidgetFactory4/nyc.jpg</property>
<object class="GtkPicture" id="notebook_nyc">
<child>
<object class="GtkDragSource">
<signal name="prepare" handler="on_picture_drag_prepare" swapped="no"/>
@@ -1316,8 +1314,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<child>
<object class="GtkNotebookPage">
<property name="child">
<object class="GtkPicture">
<property name="file">resource:///org/gtk/WidgetFactory4/beach.jpg</property>
<object class="GtkPicture" id="notebook_beach">
<child>
<object class="GtkDragSource">
<signal name="prepare" handler="on_picture_drag_prepare" swapped="no"/>
+2 -2
View File
@@ -18,12 +18,12 @@ search_index = true
docs_url = "https://docs.gtk.org/gobject/"
[dependencies."Gio-2.0"]
name = "GIO"
name = "Gio"
description = "GObject Interfaces and Objects, Networking, IPC, and I/O"
docs_url = "https://docs.gtk.org/gio/"
[dependencies."cairo-1.0"]
name = "Cairo"
name = "cairo"
description = "A 2D graphics library with support for multiple output devices"
docs_url = "https://www.cairographics.org/manual/"
+1 -1
View File
@@ -19,7 +19,7 @@ dependencies = ["Graphene-1.0", "Gdk-4.0"]
docs_url = "https://ebassi.github.io/graphene/docs/"
[dependencies."Gdk-4.0"]
name = "GDK"
name = "Gdk"
description = "The GTK windowing system abstraction"
docs_url = "https://docs.gtk.org/gdk4/"
+16 -22
View File
@@ -236,23 +236,17 @@ By default, GTK will try to build with support for the Vulkan graphics
API in addition to cairo and OpenGL. This option can be used to explicitly
control whether Vulkan should be used.
### `xinerama`
By default, GTK will try to link against the Xinerama libraries
if they are found. This option can be used to explicitly control
whether Xinerama should be used.
### `media`
### `media-gstreamer` and `media-ffmpeg`
By default, GTK will try to build the gstreamer backend for
media playback support. This option can be used to explicitly
media playback support. These option can be used to explicitly
control which media backends should be built.
### `print`
### `print-cups`
By default, GTK will try to build various print backends
if their dependencies are found. This option can be used
to explicitly control which print backends should be built.
to explicitly control whether the cups print backend should be built.
### `cloudproviders`
@@ -274,18 +268,13 @@ support in the file chooser.
This option controls whether GTK should use colord for color
calibration support in the cups print backend.
### `gtk_doc` and `man-pages`
### `gtk_doc`, `man-pages` and `update_screenshots`
The *gtk-doc* package is used to generate the reference documentation
included with GTK. By default support for *gtk-doc* is disabled
The *gi-docgen* package is used to generate the reference documentation
included with GTK. By default support for *gi-docgen* is disabled
because it requires various extra dependencies to be installed.
If you have *gtk-doc* and *pandoc* installed and are modifying GTK,
you may want to enable *gtk-doc* support by passing in `-Dgtk_doc=true`.
Additionally, some tools provided by GTK have their own
manual pages generated using a similar set of dependencies;
if you have *xsltproc* then you can generate manual pages by
passing `-Dman-pages=true` when configuring the build.
Introspection needs to be enabled, since the documentation is generated
from introspection data.
### `introspection`
@@ -294,9 +283,14 @@ is mainly useful for shortening turnaround times on developer
systems. Installed builds of GTK should always have introspection
support.
### `build-tests`, `install-tests`, `demos`
### `build-testsuite`
By default, GTK will build quite a few tests and demos.
If you want to run the testsuite to ensure that your GTK build
works, you should enable it with this option.
### `build-tests`, `build-examples`, `demos`
By default, GTK will build quite a few tests, examples and demos.
While these are useful on a developer system, they are not
needed when GTK is built e.g. for a flatpak runtime. These
options allow to disable building tests and demos.
+13 -9
View File
@@ -51,7 +51,7 @@ main (int argc,
GtkApplication *app;
int status;
app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
app = gtk_application_new ("org.gtk.example", G_APPLICATION_DEFAULT_FLAGS);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);
@@ -189,7 +189,7 @@ main (int argc,
GtkApplication *app;
int status;
app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
app = gtk_application_new ("org.gtk.example", G_APPLICATION_DEFAULT_FLAGS);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);
@@ -338,7 +338,7 @@ main (int argc,
GtkApplication *app;
int status;
app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
app = gtk_application_new ("org.gtk.example", G_APPLICATION_DEFAULT_FLAGS);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);
@@ -377,7 +377,7 @@ demonstrates input event handling with event controllers.
### Drawing in response to input
Create a new file with the following content named `example-4.c`.
Create a new file with the following content named `example-3.c`.
```c
#include <gtk/gtk.h>
@@ -560,7 +560,7 @@ main (int argc,
GtkApplication *app;
int status;
app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
app = gtk_application_new ("org.gtk.example", G_APPLICATION_DEFAULT_FLAGS);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);
@@ -572,7 +572,7 @@ main (int argc,
You can compile the program above with GCC using:
```
gcc $( pkg-config --cflags gtk4 ) -o example-4 example-4.c $( pkg-config --libs gtk4 )
gcc $( pkg-config --cflags gtk4 ) -o example-3 example-3.c $( pkg-config --libs gtk4 )
```
## Building user interfaces
@@ -587,7 +587,7 @@ XML format that can be parsed by the [class@Gtk.Builder] class.
### Packing buttons with GtkBuilder
Create a new file with the following content named `example-3.c`.
Create a new file with the following content named `example-4.c`.
```c
#include <gtk/gtk.h>
@@ -641,7 +641,7 @@ main (int argc,
g_chdir (GTK_SRCDIR);
#endif
GtkApplication *app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
GtkApplication *app = gtk_application_new ("org.gtk.example", G_APPLICATION_DEFAULT_FLAGS);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
int status = g_application_run (G_APPLICATION (app), argc, argv);
@@ -697,7 +697,7 @@ Create a new file with the following content named `builder.ui`.
You can compile the program above with GCC using:
```
gcc $( pkg-config --cflags gtk4 ) -o example-3 example-3.c $( pkg-config --libs gtk4 )
gcc $( pkg-config --cflags gtk4 ) -o example-4 example-4.c $( pkg-config --libs gtk4 )
```
Note that `GtkBuilder` can also be used to construct objects that are
@@ -1018,6 +1018,10 @@ Our application now looks like this:
In this step, we make our application show the content of all the files
that it is given on the commandline.
**Note: Providing filenames (e.g. `./exampleapp examplewin.c examplewin.h`) at
the command line is a requirement for example apps 3-9 to display as shown in
the screenshots below.**
To this end, we add a member to the struct of our application window subclass
and keep a reference to the `GtkStack` there. The first member of the struct
should be the parent type from which the class is derived. Here,
+2 -2
View File
@@ -14,12 +14,12 @@ search_index = true
dependencies = ["Gdk-4.0", "Gsk-4.0"]
[dependencies."Gdk-4.0"]
name = "GDK"
name = "Gdk"
description = "The GTK windowing system abstraction"
docs_url = "https://docs.gtk.org/gdk4/"
[dependencies."Gsk-4.0"]
name = "GSK"
name = "Gsk"
description = "The GTK rendering abstraction"
docs_url = "https://docs.gtk.org/gsk4/"
+4
View File
@@ -105,3 +105,7 @@ retire it. If you need such a widget, it is relatively trivial to create one
using a [class@Gtk.Revealer] with labels and buttons.
Other libraries, such as libadwaita, may provide replacements as well.
## gtk_show_uri is being replaced
Instead of gtk_show_uri(), you should use GtkUriLauncher or GtkFileLauncher.
+1 -1
View File
@@ -1,7 +1,7 @@
toml_conf = configuration_data()
toml_conf.set('version', meson.project_version())
gidocgen = find_program('gi-docgen', required: get_option('gtk_doc'))
gidocgen = find_program('gi-docgen', required: get_option('gtk_doc'), native: true)
gidocgen_common_args = [
'--quiet',
+1 -1
View File
@@ -106,7 +106,7 @@ activate (GApplication *app,
gtk_widget_set_halign (GTK_WIDGET (button), GTK_ALIGN_CENTER);
gtk_widget_set_valign (GTK_WIDGET (button), GTK_ALIGN_START);
gtk_window_set_child (GTK_WINDOW (window), button);
gtk_widget_show (win);
gtk_window_present (GTK_WINDOW (win));
g_object_unref (button_menu);
g_object_unref (doc_actions);
+2 -2
View File
@@ -292,7 +292,7 @@ new_window (GApplication *app,
G_CALLBACK (text_buffer_changed_cb), window);
text_buffer_changed_cb (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)), window);
gtk_widget_show (GTK_WIDGET (window));
gtk_window_present (GTK_WINDOW (window));
}
static void
@@ -465,7 +465,7 @@ edit_accels (GSimpleAction *action,
gtk_drop_down_set_selected (GTK_DROP_DOWN (combo), 0);
gtk_widget_show (dialog);
gtk_window_present (GTK_WINDOW (dialog));
}
static gboolean
+1 -1
View File
@@ -37,7 +37,7 @@ activate (GtkApplication *app,
button = gtk_builder_get_object (builder, "quit");
g_signal_connect_swapped (button, "clicked", G_CALLBACK (quit_cb), window);
gtk_widget_show (GTK_WIDGET (window));
gtk_window_present (GTK_WINDOW (window));
g_object_unref (builder);
}
+1 -1
View File
@@ -164,7 +164,7 @@ activate (GtkApplication *app,
g_signal_connect (press, "pressed", G_CALLBACK (pressed), drawing_area);
gtk_widget_show (window);
gtk_window_present (GTK_WINDOW (window));
}
int
+1 -1
View File
@@ -49,7 +49,7 @@ activate (GtkApplication *app,
*/
gtk_grid_attach (GTK_GRID (grid), button, 0, 1, 2, 1);
gtk_widget_show (window);
gtk_window_present (GTK_WINDOW (window));
}
+1 -1
View File
@@ -27,7 +27,7 @@ activate (GtkApplication *app,
gtk_window_set_child (GTK_WINDOW (window), button);
gtk_widget_show (window);
gtk_window_present (GTK_WINDOW (window));
}
int
+1 -1
View File
@@ -112,7 +112,7 @@ new_window (GApplication *app,
}
}
gtk_widget_show (GTK_WIDGET (window));
gtk_window_present (GTK_WINDOW (window));
}
static void
+2 -3
View File
@@ -2,7 +2,7 @@
static void
activate_cb (GtkApplication *app,
gpointer user_data)
gpointer user_data)
{
GtkWidget *window;
GtkWidget *search_bar;
@@ -11,12 +11,11 @@ activate_cb (GtkApplication *app,
GtkWidget *menu_button;
window = gtk_application_window_new (app);
gtk_widget_show (window);
gtk_window_present (GTK_WINDOW (window));
search_bar = gtk_search_bar_new ();
gtk_widget_set_valign (search_bar, GTK_ALIGN_START);
gtk_window_set_child (GTK_WINDOW (window), search_bar);
gtk_widget_show (search_bar);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_search_bar_set_child (GTK_SEARCH_BAR (search_bar), box);
+1 -1
View File
@@ -43,7 +43,7 @@ new_window (GApplication *app,
}
}
gtk_widget_show (GTK_WIDGET (window));
gtk_window_present (GTK_WINDOW (window));
}
static void
+1 -1
View File
@@ -9,7 +9,7 @@ activate (GtkApplication* app,
window = gtk_application_window_new (app);
gtk_window_set_title (GTK_WINDOW (window), "Window");
gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
gtk_widget_show (window);
gtk_window_present (GTK_WINDOW (window));
}
int
+5 -1
View File
@@ -118,7 +118,8 @@ static const GdkDebugKey gdk_debug_keys[] = {
{ "selection", GDK_DEBUG_SELECTION, "Information about selections" },
{ "clipboard", GDK_DEBUG_CLIPBOARD, "Information about clipboards" },
{ "nograbs", GDK_DEBUG_NOGRABS, "Disable pointer and keyboard grabs (X11)", TRUE },
{ "portals", GDK_DEBUG_PORTALS, "Force the use of portals", TRUE },
{ "portals", GDK_DEBUG_PORTALS, "Force use of portals", TRUE },
{ "no-portals", GDK_DEBUG_NO_PORTALS, "Disable use of portals", TRUE },
{ "gl-disable", GDK_DEBUG_GL_DISABLE, "Disable OpenGL support", TRUE },
{ "gl-debug", GDK_DEBUG_GL_DEBUG, "Insert debugging information in OpenGL", TRUE },
{ "gl-legacy", GDK_DEBUG_GL_LEGACY, "Use a legacy OpenGL context", TRUE },
@@ -359,6 +360,9 @@ gdk_should_use_portal (void)
if (gdk_display_get_debug_flags (NULL) & GDK_DEBUG_PORTALS)
return TRUE;
if (gdk_display_get_debug_flags (NULL) & GDK_DEBUG_NO_PORTALS)
return FALSE;
if (gdk_running_in_sandbox ())
return TRUE;
+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");
+2 -1
View File
@@ -40,7 +40,8 @@ typedef enum {
/* flags below are influencing behavior */
GDK_DEBUG_NOGRABS = 1 << 11,
GDK_DEBUG_PORTALS = 1 << 12,
GDK_DEBUG_GL_DISABLE = 1 << 13,
GDK_DEBUG_NO_PORTALS = 1 << 13,
GDK_DEBUG_GL_DISABLE = 1 << 14,
GDK_DEBUG_GL_LEGACY = 1 << 16,
GDK_DEBUG_GL_GLES = 1 << 17,
GDK_DEBUG_GL_DEBUG = 1 << 18,
+3 -3
View File
@@ -197,7 +197,7 @@ gdk_device_tool_get_serial (GdkDeviceTool *tool)
*
* Gets the hardware ID of this tool, or 0 if it's not known.
*
* When non-zero, the identificator is unique for the given tool model,
* When non-zero, the identifier is unique for the given tool model,
* meaning that two identical tools will share the same @hardware_id,
* but will have different serial numbers (see
* [method@Gdk.DeviceTool.get_serial]).
@@ -205,9 +205,9 @@ gdk_device_tool_get_serial (GdkDeviceTool *tool)
* This is a more concrete (and device specific) method to identify
* a `GdkDeviceTool` than [method@Gdk.DeviceTool.get_tool_type],
* as a tablet may support multiple devices with the same
* `GdkDeviceToolType`, but different hardware identificators.
* `GdkDeviceToolType`, but different hardware identifiers.
*
* Returns: The hardware identificator of this tool.
* Returns: The hardware identifier of this tool.
*/
guint64
gdk_device_tool_get_hardware_id (GdkDeviceTool *tool)
+7 -8
View File
@@ -471,8 +471,8 @@ gdk_display_get_event (GdkDisplay *display)
* Appends the given event onto the front of the event
* queue for @display.
*
* This function is only useful in very special situations
* and should not be used by applications.
* Deprecated: 4.10: This function is only useful in very
* special situations and should not be used by applications.
**/
void
gdk_display_put_event (GdkDisplay *display,
@@ -1114,7 +1114,7 @@ gdk_display_get_app_launch_context (GdkDisplay *display)
/**
* gdk_display_open:
* @display_name: the name of the display to open
* @display_name: (nullable): the name of the display to open
*
* Opens a display.
*
@@ -1148,6 +1148,8 @@ _gdk_display_get_next_serial (GdkDisplay *display)
* with custom startup-notification identifier unless
* [method@Gtk.Window.set_auto_startup_notification]
* is called to disable that feature.
*
* Deprecated: 4.10. Using gdk_toplevel_set_startup_id() is sufficient.
*/
void
gdk_display_notify_startup_complete (GdkDisplay *display,
@@ -1775,11 +1777,11 @@ gdk_display_init_egl (GdkDisplay *self,
gpointer
gdk_display_get_egl_display (GdkDisplay *self)
{
#ifdef HAVE_EGL
GdkDisplayPrivate *priv = gdk_display_get_instance_private (self);
g_return_val_if_fail (GDK_IS_DISPLAY (self), NULL);
#ifdef HAVE_EGL
if (!priv->egl_display &&
!gdk_display_prepare_gl (self, NULL))
return NULL;
@@ -2013,10 +2015,7 @@ gdk_display_get_monitors (GdkDisplay *self)
* Gets the monitor in which the largest area of @surface
* resides.
*
* Returns a monitor close to @surface if it is outside
* of all monitors.
*
* Returns: (transfer none): the monitor with the largest
* Returns: (transfer none) (nullable): the monitor with the largest
* overlap with @surface
*/
GdkMonitor *
+2 -2
View File
@@ -83,7 +83,7 @@ GdkClipboard * gdk_display_get_clipboard (GdkDisplay
GDK_AVAILABLE_IN_ALL
GdkClipboard * gdk_display_get_primary_clipboard (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_4_10_FOR(gdk_toplevel_set_startup_id)
void gdk_display_notify_startup_complete (GdkDisplay *display,
const char *startup_id);
GDK_AVAILABLE_IN_ALL
@@ -104,7 +104,7 @@ GDK_AVAILABLE_IN_ALL
GdkMonitor * gdk_display_get_monitor_at_surface (GdkDisplay *display,
GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_4_10
void gdk_display_put_event (GdkDisplay *display,
GdkEvent *event);
+8 -1
View File
@@ -1174,9 +1174,16 @@ gdk_event_get_axes (GdkEvent *event,
double **axes,
guint *n_axes)
{
gboolean ret;
g_return_val_if_fail (GDK_IS_EVENT (event), FALSE);
return GDK_EVENT_GET_CLASS (event)->get_axes (event, axes, n_axes);
ret = GDK_EVENT_GET_CLASS (event)->get_axes (event, axes, n_axes);
if (*axes == NULL)
return FALSE;
return ret;
}
double *
+5 -2
View File
@@ -621,8 +621,11 @@ gdk_frame_clock_paint_idle (void *data)
priv->phase = GDK_FRAME_CLOCK_PHASE_NONE;
}
#ifdef G_ENABLE_DEBUG
if (GDK_DEBUG_CHECK (FRAMES))
timings->frame_end_time = g_get_monotonic_time ();
if (GDK_DEBUG_CHECK (FRAMES))
{
if (timings)
timings->frame_end_time = g_get_monotonic_time ();
}
#endif /* G_ENABLE_DEBUG */
G_GNUC_FALLTHROUGH;
+1 -1
View File
@@ -504,8 +504,8 @@ gdk_gl_context_real_is_shared (GdkGLContext *self,
static gboolean
gdk_gl_context_real_clear_current (GdkGLContext *context)
{
GdkDisplay *display = gdk_gl_context_get_display (context);
#ifdef HAVE_EGL
GdkDisplay *display = gdk_gl_context_get_display (context);
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
if (priv->egl_context == NULL)
+19
View File
@@ -23,4 +23,23 @@ void gdk_source_set_static_name_by_id (guint tag,
#define I_(string) g_intern_static_string (string)
#endif
#if !GLIB_CHECK_VERSION (2, 75, 1)
static inline gboolean
g_set_str (char **str_pointer,
const char *new_str)
{
char *copy;
if (*str_pointer == new_str ||
(*str_pointer && new_str && strcmp (*str_pointer, new_str) == 0))
return FALSE;
copy = g_strdup (new_str);
g_free (*str_pointer);
*str_pointer = copy;
return TRUE;
}
#endif
#endif /* __GDK__PRIVATE_H__ */
+3 -3
View File
@@ -586,7 +586,7 @@ gdk_rgba_parser_parse (GtkCssParser *parser,
else if (gtk_css_token_is (token, GTK_CSS_TOKEN_HASH_ID) ||
gtk_css_token_is (token, GTK_CSS_TOKEN_HASH_UNRESTRICTED))
{
const char *s = token->string.string;
const char *s = gtk_css_token_get_string (token);
switch (strlen (s))
{
@@ -637,13 +637,13 @@ gdk_rgba_parser_parse (GtkCssParser *parser,
{
*rgba = (GdkRGBA) { 0, 0, 0, 0 };
}
else if (gdk_rgba_parse (rgba, token->string.string))
else if (gdk_rgba_parse (rgba, gtk_css_token_get_string (token)))
{
/* everything's fine */
}
else
{
gtk_css_parser_error_syntax (parser, "\"%s\" is not a valid color name.", token->string.string);
gtk_css_parser_error_syntax (parser, "\"%s\" is not a valid color name.", gtk_css_token_get_string (token));
return FALSE;
}
+17 -7
View File
@@ -2789,9 +2789,10 @@ check_autohide (GdkEvent *event)
{
GdkDisplay *display;
GdkDevice *device;
GdkSurface *grab_surface;
GdkSurface *grab_surface, *event_surface;
GdkEventType evtype = gdk_event_get_event_type (event);
switch ((guint) gdk_event_get_event_type (event))
switch ((guint) evtype)
{
case GDK_BUTTON_PRESS:
#if 0
@@ -2810,13 +2811,15 @@ check_autohide (GdkEvent *event)
device = gdk_event_get_device (event);
if (gdk_device_grab_info (display, device, &grab_surface, NULL))
{
GdkSurface *event_surface;
event_surface = gdk_event_get_surface (event);
if (event_surface->autohide &&
!event_surface->has_pointer)
event_surface = NULL;
if (grab_surface != event_surface &&
grab_surface != event_surface->parent &&
grab_surface->autohide)
if (grab_surface->autohide &&
(!event_surface ||
(grab_surface != event_surface &&
grab_surface != event_surface->parent)))
{
GdkSurface *surface = grab_surface;
@@ -2831,6 +2834,13 @@ check_autohide (GdkEvent *event)
}
}
break;
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
event_surface = gdk_event_get_surface (event);
if (event_surface->autohide &&
gdk_crossing_event_get_mode (event) == GDK_CROSSING_NORMAL)
event_surface->has_pointer = evtype == GDK_ENTER_NOTIFY;
break;
default:;
}
+1
View File
@@ -77,6 +77,7 @@ struct _GdkSurface
guint autohide : 1;
guint shortcuts_inhibited : 1;
guint request_motion : 1;
guint has_pointer : 1;
guint request_motion_id;
+3 -3
View File
@@ -463,7 +463,7 @@ gdk_texture_new_from_resource (const char *resource_path)
* Creates a new texture by loading an image from a file.
*
* The file format is detected automatically. The supported formats
* are PNG and JPEG, though more formats might be available.
* are PNG, JPEG and TIFF, though more formats might be available.
*
* If %NULL is returned, then @error will be set.
*
@@ -556,7 +556,7 @@ gdk_texture_new_from_bytes_pixbuf (GBytes *bytes,
* Creates a new texture by loading an image from memory,
*
* The file format is detected automatically. The supported formats
* are PNG and JPEG, though more formats might be available.
* are PNG, JPEG and TIFF, though more formats might be available.
*
* If %NULL is returned, then @error will be set.
*
@@ -602,7 +602,7 @@ gdk_texture_new_from_bytes (GBytes *bytes,
* Creates a new texture by loading an image from a file.
*
* The file format is detected automatically. The supported formats
* are PNG and JPEG, though more formats might be available.
* are PNG, JPEG and TIFF, though more formats might be available.
*
* If %NULL is returned, then @error will be set.
*
+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)
+5 -3
View File
@@ -576,6 +576,8 @@ typedef NSString *CALayerContentsGravity;
initialResizeLocation = convert_nspoint_to_screen (self, [self mouseLocationOutsideOfEventStream]);
}
// NSDraggingDestination protocol
-(NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
{
NSPoint location = [sender draggingLocation];
@@ -665,9 +667,9 @@ typedef NSString *CALayerContentsGravity;
return NO;
}
-(void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation
{
}
// NSDraggingSource protocol
// ...
// end
-(void)setStyleMask:(NSWindowStyleMask)styleMask
{
+4
View File
@@ -23,6 +23,10 @@
#include "gdkmacoscursor-private.h"
@interface NSCursor()
-(long long)_coreCursorType;
@end
/* OS X only exports a number of cursor types in its public NSCursor interface.
* By overriding the private _coreCursorType method, we can tell OS X to load
* one of its internal cursors instead (since cursor images are loaded on demand
-7
View File
@@ -760,16 +760,9 @@ find_surface_under_pointer (GdkMacosDisplay *self,
int *x,
int *y)
{
GdkPointerSurfaceInfo *info;
GdkMacosSurface *surface;
GdkDevice *pointer;
GdkSeat *seat;
int x_tmp, y_tmp;
seat = gdk_display_get_default_seat (GDK_DISPLAY (self));
pointer = gdk_seat_get_pointer (seat);
info = _gdk_display_get_pointer_info (GDK_DISPLAY (self), pointer);
surface = _gdk_macos_display_get_surface_at_display_coords (self,
screen_point.x,
screen_point.y,
-3
View File
@@ -870,15 +870,12 @@ _gdk_macos_display_get_surface_at_coords (GdkMacosDisplay *self,
for (const GList *iter = surfaces; iter; iter = iter->next)
{
GdkSurface *surface = iter->data;
NSWindow *nswindow;
g_assert (GDK_IS_MACOS_SURFACE (surface));
if (!gdk_surface_get_mapped (surface))
continue;
nswindow = _gdk_macos_surface_get_native (GDK_MACOS_SURFACE (surface));
if (x >= GDK_MACOS_SURFACE (surface)->root_x &&
y >= GDK_MACOS_SURFACE (surface)->root_y &&
x <= (GDK_MACOS_SURFACE (surface)->root_x + surface->width) &&
+11 -1
View File
@@ -218,6 +218,12 @@ drag_ungrab (GdkMacosDrag *self)
g_assert (GDK_IS_MACOS_DRAG (self));
if (self->drag_seat)
{
gdk_seat_ungrab (self->drag_seat);
g_clear_object (&self->drag_seat);
}
display = gdk_drag_get_display (GDK_DRAG (self));
_gdk_macos_display_break_all_grabs (GDK_MACOS_DISPLAY (display), GDK_CURRENT_TIME);
}
@@ -536,7 +542,11 @@ gdk_macos_drag_finalize (GObject *object)
GdkMacosDragSurface *drag_surface = g_steal_pointer (&self->drag_surface);
g_clear_object (&self->cursor);
g_clear_object (&self->drag_seat);
if (self->drag_seat)
{
gdk_seat_ungrab (self->drag_seat);
g_clear_object (&self->drag_seat);
}
G_OBJECT_CLASS (gdk_macos_drag_parent_class)->finalize (object);
-2
View File
@@ -460,12 +460,10 @@ gdk_macos_gl_context_begin_frame (GdkDrawContext *context,
{
GdkMacosGLContext *self = (GdkMacosGLContext *)context;
GdkMacosBuffer *buffer;
cairo_region_t *copy;
GdkSurface *surface;
g_assert (GDK_IS_MACOS_GL_CONTEXT (self));
copy = cairo_region_copy (region);
surface = gdk_draw_context_get_surface (context);
buffer = _gdk_macos_surface_get_buffer (GDK_MACOS_SURFACE (surface));
+1 -3
View File
@@ -276,10 +276,8 @@ gdk_macos_keymap_update (GdkMacosKeymap *self)
{
UInt32 state = 0;
OSStatus err;
UInt16 key_code;
UniChar uc;
key_code = modifiers[j] | i;
err = UCKeyTranslate (chr_data, i, kUCKeyActionDisplay,
(modifiers[j] >> 8) & 0xFF,
LMGetKbdType(),
@@ -369,7 +367,7 @@ gdk_macos_keymap_update (GdkMacosKeymap *self)
if (p[0] == known_numeric_keys[i].normal_keyval)
p[0] = known_numeric_keys[i].keypad_keyval;
}
for (i = 0; i < G_N_ELEMENTS (jis_keys); i++)
{
p = keyval_array + jis_keys[i].keycode * KEYVALS_PER_KEYCODE;
-2
View File
@@ -215,7 +215,6 @@ gdk_macos_monitor_display_link_cb (GdkMacosMonitor *self)
{
gint64 presentation_time;
gint64 refresh_interval;
gint64 now;
GList *iter;
g_assert (GDK_IS_MACOS_MONITOR (self));
@@ -225,7 +224,6 @@ gdk_macos_monitor_display_link_cb (GdkMacosMonitor *self)
presentation_time = self->display_link->presentation_time;
refresh_interval = self->display_link->refresh_interval;
now = g_source_get_time ((GSource *)self->display_link);
iter = self->awaiting_frames.head;
+1 -7
View File
@@ -195,7 +195,6 @@ gdk_macos_surface_hide (GdkSurface *surface)
{
GdkMacosSurface *self = (GdkMacosSurface *)surface;
GdkSeat *seat;
gboolean was_mapped;
gboolean was_key;
g_assert (GDK_IS_MACOS_SURFACE (self));
@@ -204,7 +203,6 @@ gdk_macos_surface_hide (GdkSurface *surface)
_gdk_macos_surface_cancel_frame (self);
was_mapped = GDK_SURFACE_IS_MAPPED (surface);
was_key = [self->window isKeyWindow];
seat = gdk_display_get_default_seat (surface->display);
@@ -285,14 +283,12 @@ gdk_macos_surface_end_frame (GdkMacosSurface *self)
{
GdkFrameTimings *timings;
GdkFrameClock *frame_clock;
GdkDisplay *display;
g_assert (GDK_IS_MACOS_SURFACE (self));
if (GDK_SURFACE_DESTROYED (self))
return;
display = gdk_surface_get_display (GDK_SURFACE (self));
frame_clock = gdk_surface_get_frame_clock (GDK_SURFACE (self));
if ((timings = gdk_frame_clock_get_current_timings (frame_clock)))
@@ -420,7 +416,6 @@ gdk_macos_surface_drag_begin (GdkSurface *surface,
GdkMacosSurface *drag_surface;
GdkMacosDrag *drag;
GdkCursor *cursor;
GdkSeat *seat;
double px;
double py;
int sx;
@@ -432,12 +427,11 @@ gdk_macos_surface_drag_begin (GdkSurface *surface,
g_assert (GDK_IS_MACOS_DEVICE (device));
g_assert (GDK_IS_CONTENT_PROVIDER (content));
seat = gdk_device_get_seat (device);
gdk_macos_device_query_state (device, surface, NULL, &px, &py, NULL);
_gdk_macos_surface_get_root_coords (GDK_MACOS_SURFACE (surface), &sx, &sy);
drag_surface = _gdk_macos_surface_new (GDK_MACOS_DISPLAY (surface->display),
GDK_SURFACE_DRAG,
surface,
NULL,
sx, sy, 1, 1);
drag = g_object_new (GDK_TYPE_MACOS_DRAG,
"drag-surface", drag_surface,
+1
View File
@@ -49,6 +49,7 @@
#include "gdkvulkancontext-wayland.h"
#include "gdkwaylandmonitor.h"
#include "gdkprofilerprivate.h"
#include "gdktoplevel-wayland-private.h"
#include <wayland/pointer-gestures-unstable-v1-client-protocol.h>
#include "tablet-unstable-v2-client-protocol.h"
#include <wayland/xdg-shell-unstable-v6-client-protocol.h>
+6 -10
View File
@@ -367,10 +367,10 @@ _gdk_wayland_surface_drag_begin (GdkSurface *surface,
GdkWaylandDrag *drag_wayland;
GdkDrag *drag;
GdkSeat *seat;
GdkWaylandDisplay *display_wayland;
GdkDisplay *display;
GdkCursor *cursor;
display_wayland = GDK_WAYLAND_DISPLAY (gdk_device_get_display (device));
display = gdk_device_get_display (device);
seat = gdk_device_get_seat (device);
drag_wayland = g_object_new (GDK_TYPE_WAYLAND_DRAG,
@@ -382,17 +382,13 @@ _gdk_wayland_surface_drag_begin (GdkSurface *surface,
drag = GDK_DRAG (drag_wayland);
drag_wayland->dnd_surface = create_dnd_surface (gdk_surface_get_display (surface));
drag_wayland->dnd_surface = _gdk_wayland_display_create_surface (display, GDK_SURFACE_DRAG, NULL, 0, 0, 100, 100);
drag_wayland->dnd_wl_surface = gdk_wayland_surface_get_wl_surface (drag_wayland->dnd_surface);
gdk_wayland_drag_create_data_source (drag);
if (display_wayland->data_device_manager_version >=
WL_DATA_SOURCE_SET_ACTIONS_SINCE_VERSION)
{
wl_data_source_set_actions (drag_wayland->data_source,
gdk_to_wl_actions (actions));
}
if (GDK_WAYLAND_DISPLAY (display)->data_device_manager_version >= WL_DATA_SOURCE_SET_ACTIONS_SINCE_VERSION)
wl_data_source_set_actions (drag_wayland->data_source, gdk_to_wl_actions (actions));
gdk_wayland_seat_set_drag (seat, drag);
+136
View File
@@ -0,0 +1,136 @@
/*
* Copyright © 2022 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "gdksurface-wayland.h"
#include "gdkdeviceprivate.h"
#include "gdkdisplay-wayland.h"
#include "gdkdragsurfaceprivate.h"
#include "gdkeventsprivate.h"
#include "gdkframeclockidleprivate.h"
#include "gdkglcontext-wayland.h"
#include "gdkmonitor-wayland.h"
#include "gdkpopupprivate.h"
#include "gdkprivate-wayland.h"
#include "gdkprivate-wayland.h"
#include "gdkseat-wayland.h"
#include "gdksurfaceprivate.h"
#include "gdktoplevelprivate.h"
#include "gdkdevice-wayland-private.h"
#include <wayland/xdg-shell-unstable-v6-client-protocol.h>
#include <wayland/xdg-foreign-unstable-v2-client-protocol.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <netinet/in.h>
#include <unistd.h>
#include "gdksurface-wayland-private.h"
typedef struct
{
GdkWaylandSurface parent_instance;
} GdkWaylandDragSurface;
typedef struct
{
GdkWaylandSurfaceClass parent_class;
} GdkWaylandDragSurfaceClass;
static void gdk_wayland_drag_surface_iface_init (GdkDragSurfaceInterface *iface);
#define GDK_IS_WAYLAND_DRAG_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_DRAG_SURFACE))
G_DEFINE_TYPE_WITH_CODE (GdkWaylandDragSurface, gdk_wayland_drag_surface, GDK_TYPE_WAYLAND_SURFACE,
G_IMPLEMENT_INTERFACE (GDK_TYPE_DRAG_SURFACE,
gdk_wayland_drag_surface_iface_init))
static void
gdk_wayland_drag_surface_init (GdkWaylandDragSurface *surface)
{
}
static gboolean
gdk_wayland_drag_surface_compute_size (GdkSurface *surface)
{
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
if (impl->next_layout.surface_geometry_dirty)
{
gdk_wayland_surface_update_size (surface,
impl->next_layout.configured_width,
impl->next_layout.configured_height,
impl->scale);
impl->next_layout.surface_geometry_dirty = FALSE;
}
return FALSE;
}
static void
gdk_wayland_drag_surface_class_init (GdkWaylandDragSurfaceClass *class)
{
GdkSurfaceClass *surface_class = GDK_SURFACE_CLASS (class);
surface_class->compute_size = gdk_wayland_drag_surface_compute_size;
}
static void
maybe_notify_mapped (GdkSurface *surface)
{
if (surface->destroyed)
return;
if (!GDK_SURFACE_IS_MAPPED (surface))
gdk_surface_set_is_mapped (surface, TRUE);
}
static gboolean
gdk_wayland_drag_surface_present (GdkDragSurface *drag_surface,
int width,
int height)
{
GdkSurface *surface = GDK_SURFACE (drag_surface);
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
if (!impl->display_server.wl_surface)
gdk_wayland_surface_create_wl_surface (surface);
impl->next_layout.configured_width = width;
impl->next_layout.configured_height = height;
impl->next_layout.surface_geometry_dirty = TRUE;
gdk_surface_request_layout (surface);
maybe_notify_mapped (surface);
return TRUE;
}
static void
gdk_wayland_drag_surface_iface_init (GdkDragSurfaceInterface *iface)
{
iface->present = gdk_wayland_drag_surface_present;
}
File diff suppressed because it is too large Load Diff
-2
View File
@@ -191,8 +191,6 @@ void gdk_wayland_surface_restore_shortcuts (GdkSurface *surface,
void gdk_wayland_surface_update_scale (GdkSurface *surface);
GdkSurface * create_dnd_surface (GdkDisplay *display);
GdkModifierType gdk_wayland_keymap_get_gdk_modifiers (GdkKeymap *keymap,
guint32 mods);
+121
View File
@@ -0,0 +1,121 @@
/*
* Copyright © 2022 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
typedef enum _PopupState
{
POPUP_STATE_IDLE,
POPUP_STATE_WAITING_FOR_REPOSITIONED,
POPUP_STATE_WAITING_FOR_CONFIGURE,
POPUP_STATE_WAITING_FOR_FRAME,
} PopupState;
struct _GdkWaylandSurface
{
GdkSurface parent_instance;
struct {
GSList *outputs;
struct wl_surface *wl_surface;
struct xdg_surface *xdg_surface;
struct zxdg_surface_v6 *zxdg_surface_v6;
struct wl_egl_window *egl_window;
} display_server;
struct wl_event_queue *event_queue;
unsigned int initial_configure_received : 1;
unsigned int has_uncommitted_ack_configure : 1;
unsigned int mapped : 1;
unsigned int awaiting_frame : 1;
unsigned int awaiting_frame_frozen : 1;
int pending_buffer_offset_x;
int pending_buffer_offset_y;
gint64 pending_frame_counter;
guint32 scale;
int shadow_left;
int shadow_right;
int shadow_top;
int shadow_bottom;
cairo_region_t *opaque_region;
gboolean opaque_region_dirty;
cairo_region_t *input_region;
gboolean input_region_dirty;
GdkRectangle last_sent_window_geometry;
struct {
gboolean is_initial_configure;
uint32_t serial;
gboolean is_dirty;
} pending;
struct {
int configured_width;
int configured_height;
gboolean surface_geometry_dirty;
} next_layout;
uint32_t last_configure_serial;
int state_freeze_count;
};
typedef struct _GdkWaylandSurfaceClass GdkWaylandSurfaceClass;
struct _GdkWaylandSurfaceClass
{
GdkSurfaceClass parent_class;
void (* handle_configure) (GdkWaylandSurface *surface);
void (* handle_frame) (GdkWaylandSurface *surface);
void (* hide_surface) (GdkWaylandSurface *surface);
};
#define GDK_WAYLAND_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WAYLAND_SURFACE, GdkWaylandSurfaceClass))
#define GDK_WAYLAND_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WAYLAND_SURFACE, GdkWaylandSurfaceClass))
void gdk_wayland_surface_create_wl_surface (GdkSurface *surface);
void gdk_wayland_surface_update_size (GdkSurface *surface,
int32_t width,
int32_t height,
int scale);
void gdk_wayland_surface_create_xdg_surface_resources (GdkSurface *surface);
void _gdk_wayland_surface_save_size (GdkSurface *surface);
void gdk_wayland_surface_hide_surface (GdkSurface *surface);
void gdk_wayland_surface_move_resize (GdkSurface *surface,
int x,
int y,
int width,
int height);
void gdk_wayland_surface_get_window_geometry (GdkSurface *surface,
GdkRectangle *geometry);
void gdk_wayland_surface_freeze_state (GdkSurface *surface);
void gdk_wayland_surface_thaw_state (GdkSurface *surface);
#define GDK_TYPE_WAYLAND_DRAG_SURFACE (gdk_wayland_drag_surface_get_type ())
GType gdk_wayland_drag_surface_get_type (void) G_GNUC_CONST;
File diff suppressed because it is too large Load Diff
+2 -17
View File
@@ -21,26 +21,11 @@
#pragma once
#include "gdkwaylandsurface.h"
#include "gdkwaylandtoplevel.h"
#include "gdkwaylandpopup.h"
G_BEGIN_DECLS
void gdk_wayland_toplevel_set_dbus_properties (GdkToplevel *toplevel,
const char *application_id,
const char *app_menu_path,
const char *menubar_path,
const char *window_object_path,
const char *application_object_path,
const char *unique_bus_name);
void gdk_wayland_toplevel_announce_csd (GdkToplevel *toplevel);
void gdk_wayland_toplevel_announce_ssd (GdkToplevel *toplevel);
gboolean gdk_wayland_toplevel_inhibit_idle (GdkToplevel *toplevel);
void gdk_wayland_toplevel_uninhibit_idle (GdkToplevel *toplevel);
struct gtk_surface1 * gdk_wayland_toplevel_get_gtk_surface (GdkWaylandToplevel *wayland_toplevel);
void gdk_wayland_surface_ensure_wl_egl_window (GdkSurface *surface);
G_END_DECLS
+41
View File
@@ -0,0 +1,41 @@
/*
* Copyright © 2022 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
void gdk_wayland_toplevel_set_geometry_hints (GdkWaylandToplevel *toplevel,
const GdkGeometry *geometry,
GdkSurfaceHints geom_mask);
struct gtk_surface1 *
gdk_wayland_toplevel_get_gtk_surface (GdkWaylandToplevel *wayland_toplevel);
void gdk_wayland_toplevel_set_dbus_properties (GdkToplevel *toplevel,
const char *application_id,
const char *app_menu_path,
const char *menubar_path,
const char *window_object_path,
const char *application_object_path,
const char *unique_bus_name);
void gdk_wayland_toplevel_announce_csd (GdkToplevel *toplevel);
void gdk_wayland_toplevel_announce_ssd (GdkToplevel *toplevel);
gboolean gdk_wayland_toplevel_inhibit_idle (GdkToplevel *toplevel);
void gdk_wayland_toplevel_uninhibit_idle (GdkToplevel *toplevel);
File diff suppressed because it is too large Load Diff
+3 -1
View File
@@ -31,10 +31,12 @@
#include <gdk/wayland/gdkwaylanddevice.h>
#include <gdk/wayland/gdkwaylanddisplay.h>
#include <gdk/wayland/gdkwaylandglcontext.h>
#include <gdk/wayland/gdkwaylandmonitor.h>
#include <gdk/wayland/gdkwaylandpopup.h>
#include <gdk/wayland/gdkwaylandseat.h>
#include <gdk/wayland/gdkwaylandsurface.h>
#include <gdk/wayland/gdkwaylandglcontext.h>
#include <gdk/wayland/gdkwaylandtoplevel.h>
#undef __GDKWAYLAND_H_INSIDE__
+44
View File
@@ -0,0 +1,44 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2013 Jan Arne Petersen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#if !defined (__GDKWAYLAND_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gdk/wayland/gdkwayland.h> can be included directly."
#endif
#include <gdk/gdk.h>
#include <gdk/wayland/gdkwaylandsurface.h>
#include <wayland-client.h>
G_BEGIN_DECLS
#ifdef GTK_COMPILATION
typedef struct _GdkWaylandPopup GdkWaylandPopup;
#else
typedef GdkPopup GdkWaylandPopup;
#endif
#define GDK_TYPE_WAYLAND_POPUP (gdk_wayland_popup_get_type())
#define GDK_WAYLAND_POPUP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_POPUP, GdkWaylandPopup))
#define GDK_IS_WAYLAND_POPUP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_POPUP))
GDK_AVAILABLE_IN_ALL
GType gdk_wayland_popup_get_type (void);
G_END_DECLS
-39
View File
@@ -30,59 +30,20 @@ G_BEGIN_DECLS
#ifdef GTK_COMPILATION
typedef struct _GdkWaylandSurface GdkWaylandSurface;
typedef struct _GdkWaylandToplevel GdkWaylandToplevel;
typedef struct _GdkWaylandPopup GdkWaylandPopup;
#else
typedef GdkSurface GdkWaylandSurface;
typedef GdkToplevel GdkWaylandToplevel;
typedef GdkPopup GdkWaylandPopup;
#endif
#define GDK_TYPE_WAYLAND_SURFACE (gdk_wayland_surface_get_type())
#define GDK_WAYLAND_SURFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_SURFACE, GdkWaylandSurface))
#define GDK_IS_WAYLAND_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_SURFACE))
#define GDK_TYPE_WAYLAND_TOPLEVEL (gdk_wayland_toplevel_get_type())
#define GDK_WAYLAND_TOPLEVEL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_TOPLEVEL, GdkWaylandToplevel))
#define GDK_IS_WAYLAND_TOPLEVEL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_TOPLEVEL))
#define GDK_TYPE_WAYLAND_POPUP (gdk_wayland_popup_get_type())
#define GDK_WAYLAND_POPUP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_POPUP, GdkWaylandPopup))
#define GDK_IS_WAYLAND_POPUP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_POPUP))
GDK_AVAILABLE_IN_ALL
GType gdk_wayland_surface_get_type (void);
GDK_AVAILABLE_IN_ALL
GType gdk_wayland_toplevel_get_type (void);
GDK_AVAILABLE_IN_ALL
GType gdk_wayland_popup_get_type (void);
GDK_AVAILABLE_IN_ALL
struct wl_surface *gdk_wayland_surface_get_wl_surface (GdkSurface *surface);
typedef void (*GdkWaylandToplevelExported) (GdkToplevel *toplevel,
const char *handle,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
gboolean gdk_wayland_toplevel_export_handle (GdkToplevel *toplevel,
GdkWaylandToplevelExported callback,
gpointer user_data,
GDestroyNotify destroy_func);
GDK_AVAILABLE_IN_ALL
void gdk_wayland_toplevel_unexport_handle (GdkToplevel *toplevel);
GDK_AVAILABLE_IN_ALL
gboolean gdk_wayland_toplevel_set_transient_for_exported (GdkToplevel *toplevel,
const char *parent_handle_str);
GDK_AVAILABLE_IN_ALL
void gdk_wayland_toplevel_set_application_id (GdkToplevel *toplevel,
const char *application_id);
G_END_DECLS
#endif /* __GDK_WAYLAND_SURFACE_H__ */
+66
View File
@@ -0,0 +1,66 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2013 Jan Arne Petersen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#if !defined (__GDKWAYLAND_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gdk/wayland/gdkwayland.h> can be included directly."
#endif
#include <gdk/gdk.h>
#include <gdk/wayland/gdkwaylandsurface.h>
#include <wayland-client.h>
G_BEGIN_DECLS
#ifdef GTK_COMPILATION
typedef struct _GdkWaylandToplevel GdkWaylandToplevel;
#else
typedef GdkToplevel GdkWaylandToplevel;
#endif
#define GDK_TYPE_WAYLAND_TOPLEVEL (gdk_wayland_toplevel_get_type())
#define GDK_WAYLAND_TOPLEVEL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_TOPLEVEL, GdkWaylandToplevel))
#define GDK_IS_WAYLAND_TOPLEVEL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_TOPLEVEL))
GDK_AVAILABLE_IN_ALL
GType gdk_wayland_toplevel_get_type (void);
typedef void (*GdkWaylandToplevelExported) (GdkToplevel *toplevel,
const char *handle,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
gboolean gdk_wayland_toplevel_export_handle (GdkToplevel *toplevel,
GdkWaylandToplevelExported callback,
gpointer user_data,
GDestroyNotify destroy_func);
GDK_AVAILABLE_IN_ALL
void gdk_wayland_toplevel_unexport_handle (GdkToplevel *toplevel);
GDK_AVAILABLE_IN_ALL
gboolean gdk_wayland_toplevel_set_transient_for_exported (GdkToplevel *toplevel,
const char *parent_handle_str);
GDK_AVAILABLE_IN_ALL
void gdk_wayland_toplevel_set_application_id (GdkToplevel *toplevel,
const char *application_id);
G_END_DECLS
+6 -1
View File
@@ -8,14 +8,17 @@ gdk_wayland_sources = files([
'gdkdevice-wayland.c',
'gdkdisplay-wayland.c',
'gdkdrag-wayland.c',
'gdkdragsurface-wayland.c',
'gdkdrop-wayland.c',
'gdkeventsource.c',
'gdkglcontext-wayland.c',
'gdkkeys-wayland.c',
'gdkmonitor-wayland.c',
'gdkprimary-wayland.c',
'gdkvulkancontext-wayland.c',
'gdksurface-wayland.c',
'gdktoplevel-wayland.c',
'gdkpopup-wayland.c',
'gdkvulkancontext-wayland.c',
'wm-button-layout-translation.c',
])
@@ -24,8 +27,10 @@ gdk_wayland_public_headers = files([
'gdkwaylanddisplay.h',
'gdkwaylandglcontext.h',
'gdkwaylandmonitor.h',
'gdkwaylandpopup.h',
'gdkwaylandseat.h',
'gdkwaylandsurface.h',
'gdkwaylandtoplevel.h',
])
install_headers(gdk_wayland_public_headers, 'gdkwayland.h', subdir: 'gtk-4.0/gdk/wayland/')
+19 -5
View File
@@ -2081,23 +2081,30 @@ transmute_cf_unicodetext_to_utf8_string (const guchar *data,
gsize *set_data_length,
GDestroyNotify *set_data_destroy)
{
wchar_t *ptr, *p, *q;
wchar_t *ptr, *p, *q, *endp;
char *result;
glong wclen, u8_len;
/* Strip out \r */
/* Replace CR and CR+LF with LF */
ptr = (wchar_t *) data;
p = ptr;
q = ptr;
endp = ptr + length / 2;
wclen = 0;
while (p < ptr + length / 2)
while (p < endp)
{
if (*p != L'\r')
{
*q++ = *p;
wclen++;
}
else if (p + 1 >= endp || *(p + 1) != L'\n')
{
*q++ = L'\n';
wclen++;
}
p++;
}
@@ -2282,7 +2289,7 @@ transmute_cf_text_to_utf8_string (const guchar *data,
gsize *set_data_length,
GDestroyNotify *set_data_destroy)
{
char *ptr, *p, *q;
char *ptr, *p, *q, *endp;
char *result;
glong wclen, u8_len;
wchar_t *wstr;
@@ -2291,15 +2298,22 @@ transmute_cf_text_to_utf8_string (const guchar *data,
ptr = (char *) data;
p = ptr;
q = ptr;
endp = ptr + length / 2;
wclen = 0;
while (p < ptr + length / 2)
while (p < endp)
{
if (*p != '\r')
{
*q++ = *p;
wclen++;
}
else if (p + 1 > endp || *(p + 1) != '\n')
{
*q++ = '\n';
wclen++;
}
p++;
}
+22 -18
View File
@@ -2731,22 +2731,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) ||
@@ -2990,6 +2983,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)))
@@ -3050,9 +3045,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) &&
+3
View File
@@ -283,6 +283,9 @@ gdk_x11_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
GFileInfo *fileinfo;
GdkAppLaunchContext *ctx;
if (!info)
return NULL;
ctx = GDK_APP_LAUNCH_CONTEXT (context);
display = ctx->display;
+2
View File
@@ -1450,7 +1450,9 @@ _gdk_device_manager_xi2_handle_focus (GdkSurface *surface,
GdkEvent *event;
event = gdk_focus_event_new (surface, device, focus_in);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gdk_display_put_event (gdk_surface_get_display (surface), event);
G_GNUC_END_IGNORE_DEPRECATIONS
gdk_event_unref (event);
}
}
+4
View File
@@ -119,7 +119,9 @@ handle_focus_change (GdkEvent *event)
focus_event = gdk_focus_event_new (gdk_event_get_surface (event),
gdk_event_get_device (event),
focus_in);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gdk_display_put_event (gdk_event_get_display (event), focus_event);
G_GNUC_END_IGNORE_DEPRECATIONS
gdk_event_unref (focus_event);
}
}
@@ -206,7 +208,9 @@ handle_touch_synthetic_crossing (GdkEvent *event)
if (crossing)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gdk_display_put_event (gdk_seat_get_display (seat), crossing);
G_GNUC_END_IGNORE_DEPRECATIONS
gdk_event_unref (crossing);
}
}
+1 -1
View File
@@ -982,7 +982,7 @@ gdk_x11_selection_output_streams_request (GdkDisplay *display,
GOutputStream *stream;
if (special_targets[i].mime_type)
mime_type = gdk_intern_mime_type (special_targets[i].mime_type);
gdk_intern_mime_type (special_targets[i].mime_type);
stream = gdk_x11_selection_output_stream_new (display,
notify,
requestor,
+20
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);
@@ -2646,6 +2648,7 @@ gdk_x11_surface_set_startup_id (GdkSurface *surface,
const char *startup_id)
{
GdkDisplay *display;
char *free_this = NULL;
g_return_if_fail (GDK_IS_SURFACE (surface));
@@ -2662,6 +2665,23 @@ gdk_x11_surface_set_startup_id (GdkSurface *surface,
else
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (surface),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_STARTUP_ID"));
if (startup_id == NULL)
{
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
startup_id = free_this = display_x11->startup_notification_id;
display_x11->startup_notification_id = NULL;
if (startup_id == NULL)
return;
}
gdk_x11_display_broadcast_startup_message (display, "remove",
"ID", startup_id,
NULL);
g_free (free_this);
}
static void
+1 -1
View File
@@ -184,7 +184,7 @@ gsk_gl_driver_shader_weak_cb (gpointer data,
}
}
G_GNUC_NULL_TERMINATED static inline GBytes *
G_GNUC_UNUSED G_GNUC_NULL_TERMINATED static inline GBytes *
join_sources (GBytes *first_bytes,
...)
{
+3 -3
View File
@@ -418,7 +418,7 @@ parse_string (GtkCssParser *parser,
if (!gtk_css_token_is (token, GTK_CSS_TOKEN_STRING))
return FALSE;
s = g_strdup (token->string.string);
s = g_strdup (gtk_css_token_get_string (token));
gtk_css_parser_consume_token (parser);
g_free (*(char **) out_string);
@@ -931,7 +931,7 @@ parse_declarations (GtkCssParser *parser,
{
if (gtk_css_parser_has_token (parser, GTK_CSS_TOKEN_IDENT))
gtk_css_parser_error_syntax (parser, "No variable named \"%s\"",
gtk_css_parser_get_token (parser)->string.string);
gtk_css_token_get_string (gtk_css_parser_get_token (parser)));
else
gtk_css_parser_error_syntax (parser, "Expected a variable name");
}
@@ -1894,7 +1894,7 @@ parse_node (GtkCssParser *parser,
if (gtk_css_parser_has_token (parser, GTK_CSS_TOKEN_IDENT))
gtk_css_parser_error_value (parser, "\"%s\" is not a valid node name",
gtk_css_parser_get_token (parser)->string.string);
gtk_css_token_get_string (gtk_css_parser_get_token (parser)));
else
gtk_css_parser_error_syntax (parser, "Expected a node name");
+3
View File
@@ -444,6 +444,9 @@ gtk_at_spi_cache_remove_context (GtkAtSpiCache *self,
g_return_if_fail (GTK_IS_AT_SPI_CONTEXT (context));
const char *path = gtk_at_spi_context_get_context_path (context);
if (path == NULL)
return;
if (!g_hash_table_contains (self->contexts_by_path, path))
return;
+2 -1
View File
@@ -690,7 +690,8 @@ gtk_at_spi_root_constructed (GObject *gobject)
/* No need to validate the path */
self->base_path = g_strconcat (app_path, "/a11y", NULL);
}
else
if (self->base_path == NULL)
{
const char *program_name = g_get_prgname ();
-72
View File
@@ -1,72 +0,0 @@
/* GSK - The GIMP Toolkit
* Copyright (C) 2019 Benjamin Otte <otte@gnome.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "gtkcsslocationprivate.h"
/**
* GtkCssLocation:
* @bytes: number of bytes parsed since the beginning
* @chars: number of characters parsed since the beginning
* @lines: number of full lines that have been parsed. If you want to
* display this as a line number, you need to add 1 to this.
* @line_bytes: Number of bytes parsed since the last line break
* @line_chars: Number of characters parsed since the last line break
*
* Represents a location in a file or other source of data parsed
* by the CSS engine.
*
* The @bytes and @line_bytes offsets are meant to be used to
* programmatically match data. The @lines and @line_chars offsets
* can be used for printing the location in a file.
*
* Note that the @lines parameter starts from 0 and is increased
* whenever a CSS line break is encountered. (CSS defines the C character
* sequences "\r\n", "\r", "\n" and "\f" as newlines.)
* If your document uses different rules for line breaking, you might want
* run into problems here.
*/
void
gtk_css_location_init (GtkCssLocation *location)
{
memset (location, 0, sizeof (GtkCssLocation));
}
void
gtk_css_location_advance (GtkCssLocation *location,
gsize bytes,
gsize chars)
{
location->bytes += bytes;
location->chars += chars;
location->line_bytes += bytes;
location->line_chars += chars;
}
void
gtk_css_location_advance_newline (GtkCssLocation *location,
gboolean is_windows)
{
gtk_css_location_advance (location, is_windows ? 2 : 1, is_windows ? 2 : 1);
location->lines++;
location->line_bytes = 0;
location->line_chars = 0;
}
+26 -6
View File
@@ -25,13 +25,33 @@
G_BEGIN_DECLS
void gtk_css_location_init (GtkCssLocation *location);
static inline void
gtk_css_location_init (GtkCssLocation *location)
{
memset (location, 0, sizeof (GtkCssLocation));
}
void gtk_css_location_advance (GtkCssLocation *location,
gsize bytes,
gsize chars);
void gtk_css_location_advance_newline (GtkCssLocation *location,
gboolean is_windows);
static inline void
gtk_css_location_advance (GtkCssLocation *location,
gsize bytes,
gsize chars)
{
location->bytes += bytes;
location->chars += chars;
location->line_bytes += bytes;
location->line_chars += chars;
}
static inline void
gtk_css_location_advance_newline (GtkCssLocation *location,
gboolean is_windows)
{
location->bytes += is_windows ? 2 : 1;
location->chars += is_windows ? 2 : 1;
location->line_bytes = 0;
location->line_chars = 0;
location->lines++;
}
G_END_DECLS
+11 -12
View File
@@ -642,13 +642,13 @@ gtk_css_parser_consume_function (GtkCssParser *self,
{
const GtkCssToken *token;
gboolean result = FALSE;
char *function_name;
char function_name[64];
guint arg;
token = gtk_css_parser_get_token (self);
g_return_val_if_fail (gtk_css_token_is (token, GTK_CSS_TOKEN_FUNCTION), FALSE);
function_name = g_strdup (token->string.string);
g_strlcpy (function_name, gtk_css_token_get_string (token), 64);
gtk_css_parser_start_block (self);
arg = 0;
@@ -691,7 +691,6 @@ gtk_css_parser_consume_function (GtkCssParser *self,
}
gtk_css_parser_end_block (self);
g_free (function_name);
return result;
}
@@ -734,7 +733,7 @@ gtk_css_parser_has_ident (GtkCssParser *self,
token = gtk_css_parser_get_token (self);
return gtk_css_token_is (token, GTK_CSS_TOKEN_IDENT) &&
g_ascii_strcasecmp (token->string.string, ident) == 0;
g_ascii_strcasecmp (gtk_css_token_get_string (token), ident) == 0;
}
gboolean
@@ -756,7 +755,7 @@ gtk_css_parser_has_integer (GtkCssParser *self)
* Checks if the next token is a function with the given @name.
*
* Returns: %TRUE if the next token is a function with the given @name
**/
*/
gboolean
gtk_css_parser_has_function (GtkCssParser *self,
const char *name)
@@ -766,7 +765,7 @@ gtk_css_parser_has_function (GtkCssParser *self,
token = gtk_css_parser_get_token (self);
return gtk_css_token_is (token, GTK_CSS_TOKEN_FUNCTION) &&
g_ascii_strcasecmp (token->string.string, name) == 0;
g_ascii_strcasecmp (gtk_css_token_get_string (token), name) == 0;
}
/**
@@ -819,7 +818,7 @@ gtk_css_parser_try_ident (GtkCssParser *self,
token = gtk_css_parser_get_token (self);
if (!gtk_css_token_is (token, GTK_CSS_TOKEN_IDENT) ||
g_ascii_strcasecmp (token->string.string, ident) != 0)
g_ascii_strcasecmp (gtk_css_token_get_string (token), ident) != 0)
return FALSE;
gtk_css_parser_consume_token (self);
@@ -846,7 +845,7 @@ gtk_css_parser_try_at_keyword (GtkCssParser *self,
token = gtk_css_parser_get_token (self);
if (!gtk_css_token_is (token, GTK_CSS_TOKEN_AT_KEYWORD) ||
g_ascii_strcasecmp (token->string.string, keyword) != 0)
g_ascii_strcasecmp (gtk_css_token_get_string (token), keyword) != 0)
return FALSE;
gtk_css_parser_consume_token (self);
@@ -908,7 +907,7 @@ gtk_css_parser_consume_ident (GtkCssParser *self)
return NULL;
}
ident = g_strdup (token->string.string);
ident = g_strdup (gtk_css_token_get_string (token));
gtk_css_parser_consume_token (self);
return ident;
@@ -939,7 +938,7 @@ gtk_css_parser_consume_string (GtkCssParser *self)
return NULL;
}
ident = g_strdup (token->string.string);
ident = g_strdup (gtk_css_token_get_string (token));
gtk_css_parser_consume_token (self);
return ident;
@@ -963,7 +962,7 @@ gtk_css_parser_parse_url_arg (GtkCssParser *parser,
* gtk_css_parser_consume_url:
* @self: a `GtkCssParser`
*
* If the parser matches the <url> token from the [CSS
* If the parser matches the `<url>` token from the [CSS
* specification](https://drafts.csswg.org/css-values-4/#url-value),
* consumes it, resolves the URL and returns the resulting `GFile`.
* On failure, an error is emitted and %NULL is returned.
@@ -980,7 +979,7 @@ gtk_css_parser_consume_url (GtkCssParser *self)
if (gtk_css_token_is (token, GTK_CSS_TOKEN_URL))
{
url = g_strdup (token->string.string);
url = g_strdup (gtk_css_token_get_string (token));
gtk_css_parser_consume_token (self);
}
else if (gtk_css_token_is_function (token, "url"))
+49 -51
View File
@@ -50,18 +50,14 @@ gtk_css_token_clear (GtkCssToken *token)
case GTK_CSS_TOKEN_HASH_UNRESTRICTED:
case GTK_CSS_TOKEN_HASH_ID:
case GTK_CSS_TOKEN_URL:
g_free (token->string.string);
if (token->string.len >= 16)
g_free (token->string.u.string);
break;
case GTK_CSS_TOKEN_SIGNED_INTEGER_DIMENSION:
case GTK_CSS_TOKEN_SIGNLESS_INTEGER_DIMENSION:
case GTK_CSS_TOKEN_SIGNED_DIMENSION:
case GTK_CSS_TOKEN_SIGNLESS_DIMENSION:
g_free (token->dimension.dimension);
break;
default:
g_assert_not_reached ();
case GTK_CSS_TOKEN_EOF:
case GTK_CSS_TOKEN_WHITESPACE:
case GTK_CSS_TOKEN_OPEN_PARENS:
@@ -91,6 +87,9 @@ gtk_css_token_clear (GtkCssToken *token)
case GTK_CSS_TOKEN_BAD_URL:
case GTK_CSS_TOKEN_COMMENT:
break;
default:
g_assert_not_reached ();
}
token->type = GTK_CSS_TOKEN_EOF;
@@ -296,7 +295,7 @@ gtk_css_token_is_ident (const GtkCssToken *token,
const char *ident)
{
return gtk_css_token_is (token, GTK_CSS_TOKEN_IDENT)
&& (g_ascii_strcasecmp (token->string.string, ident) == 0);
&& (g_ascii_strcasecmp (gtk_css_token_get_string (token), ident) == 0);
}
gboolean
@@ -304,7 +303,7 @@ gtk_css_token_is_function (const GtkCssToken *token,
const char *ident)
{
return gtk_css_token_is (token, GTK_CSS_TOKEN_FUNCTION)
&& (g_ascii_strcasecmp (token->string.string, ident) == 0);
&& (g_ascii_strcasecmp (gtk_css_token_get_string (token), ident) == 0);
}
gboolean
@@ -324,33 +323,33 @@ gtk_css_token_print (const GtkCssToken *token,
switch (token->type)
{
case GTK_CSS_TOKEN_STRING:
append_string (string, token->string.string);
append_string (string, gtk_css_token_get_string (token));
break;
case GTK_CSS_TOKEN_IDENT:
append_ident (string, token->string.string);
append_ident (string, gtk_css_token_get_string (token));
break;
case GTK_CSS_TOKEN_URL:
g_string_append (string, "url(");
append_ident (string, token->string.string);
append_ident (string, gtk_css_token_get_string (token));
g_string_append (string, ")");
break;
case GTK_CSS_TOKEN_FUNCTION:
append_ident (string, token->string.string);
append_ident (string, gtk_css_token_get_string (token));
g_string_append_c (string, '(');
break;
case GTK_CSS_TOKEN_AT_KEYWORD:
g_string_append_c (string, '@');
append_ident (string, token->string.string);
append_ident (string, gtk_css_token_get_string (token));
break;
case GTK_CSS_TOKEN_HASH_UNRESTRICTED:
case GTK_CSS_TOKEN_HASH_ID:
g_string_append_c (string, '#');
append_ident (string, token->string.string);
append_ident (string, gtk_css_token_get_string (token));
break;
case GTK_CSS_TOKEN_DELIM:
@@ -492,7 +491,7 @@ gtk_css_token_to_string (const GtkCssToken *token)
static void
gtk_css_token_init_string (GtkCssToken *token,
GtkCssTokenType type,
char *string)
GString *string)
{
token->type = type;
@@ -505,7 +504,11 @@ gtk_css_token_init_string (GtkCssToken *token,
case GTK_CSS_TOKEN_HASH_UNRESTRICTED:
case GTK_CSS_TOKEN_HASH_ID:
case GTK_CSS_TOKEN_URL:
token->string.string = string;
token->string.len = string->len;
if (string->len < 16)
g_strlcpy (token->string.u.buf, string->str, 16);
else
token->string.u.string = g_strdup (string->str);
break;
default:
g_assert_not_reached ();
@@ -545,7 +548,7 @@ static void
gtk_css_token_init_dimension (GtkCssToken *token,
GtkCssTokenType type,
double value,
char *dimension)
GString *string)
{
token->type = type;
@@ -556,7 +559,7 @@ gtk_css_token_init_dimension (GtkCssToken *token,
case GTK_CSS_TOKEN_SIGNED_DIMENSION:
case GTK_CSS_TOKEN_SIGNLESS_DIMENSION:
token->dimension.value = value;
token->dimension.dimension = dimension;
g_strlcpy (token->dimension.dimension, string->str, 8);
break;
default:
g_assert_not_reached ();
@@ -630,7 +633,7 @@ gtk_css_tokenizer_parse_error (GError **error,
va_end (args);
}
static gboolean
static inline gboolean
is_newline (char c)
{
return c == '\n'
@@ -638,7 +641,7 @@ is_newline (char c)
|| c == '\f';
}
static gboolean
static inline gboolean
is_whitespace (char c)
{
return is_newline (c)
@@ -646,13 +649,13 @@ is_whitespace (char c)
|| c == ' ';
}
static gboolean
static inline gboolean
is_multibyte (char c)
{
return c & 0x80;
}
static gboolean
static inline gboolean
is_name_start (char c)
{
return is_multibyte (c)
@@ -660,7 +663,7 @@ is_name_start (char c)
|| c == '_';
}
static gboolean
static inline gboolean
is_name (char c)
{
return is_name_start (c)
@@ -668,7 +671,7 @@ is_name (char c)
|| c == '-';
}
static gboolean
static inline gboolean
is_non_printable (char c)
{
return (c >= 0 && c <= 0x08)
@@ -678,7 +681,7 @@ is_non_printable (char c)
|| c == 0x7F;
}
static gboolean
static inline gboolean
is_valid_escape (const char *data,
const char *end)
{
@@ -703,7 +706,7 @@ gtk_css_tokenizer_remaining (GtkCssTokenizer *tokenizer)
return tokenizer->end - tokenizer->data;
}
static gboolean
static inline gboolean
gtk_css_tokenizer_has_valid_escape (GtkCssTokenizer *tokenizer)
{
return is_valid_escape (tokenizer->data, tokenizer->end);
@@ -875,7 +878,7 @@ gtk_css_tokenizer_read_escape (GtkCssTokenizer *tokenizer)
return value;
}
static char *
static void
gtk_css_tokenizer_read_name (GtkCssTokenizer *tokenizer)
{
g_string_set_size (tokenizer->name_buffer, 0);
@@ -911,8 +914,6 @@ gtk_css_tokenizer_read_name (GtkCssTokenizer *tokenizer)
}
}
while (tokenizer->data != tokenizer->end);
return g_strndup (tokenizer->name_buffer->str, tokenizer->name_buffer->len);
}
static void
@@ -1005,7 +1006,8 @@ gtk_css_tokenizer_read_url (GtkCssTokenizer *tokenizer,
}
}
gtk_css_token_init_string (token, GTK_CSS_TOKEN_URL, g_string_free (url, FALSE));
gtk_css_token_init_string (token, GTK_CSS_TOKEN_URL, url);
g_string_free (url, TRUE);
return TRUE;
}
@@ -1015,12 +1017,12 @@ gtk_css_tokenizer_read_ident_like (GtkCssTokenizer *tokenizer,
GtkCssToken *token,
GError **error)
{
char *name = gtk_css_tokenizer_read_name (tokenizer);
gtk_css_tokenizer_read_name (tokenizer);
if (*tokenizer->data == '(')
{
gtk_css_tokenizer_consume_ascii (tokenizer);
if (g_ascii_strcasecmp (name, "url") == 0)
if (g_ascii_strcasecmp (tokenizer->name_buffer->str, "url") == 0)
{
const char *data = tokenizer->data;
@@ -1028,18 +1030,15 @@ gtk_css_tokenizer_read_ident_like (GtkCssTokenizer *tokenizer,
data++;
if (*data != '"' && *data != '\'')
{
g_free (name);
return gtk_css_tokenizer_read_url (tokenizer, token, error);
}
return gtk_css_tokenizer_read_url (tokenizer, token, error);
}
gtk_css_token_init_string (token, GTK_CSS_TOKEN_FUNCTION, name);
gtk_css_token_init_string (token, GTK_CSS_TOKEN_FUNCTION, tokenizer->name_buffer);
return TRUE;
}
else
{
gtk_css_token_init_string (token, GTK_CSS_TOKEN_IDENT, name);
gtk_css_token_init_string (token, GTK_CSS_TOKEN_IDENT, tokenizer->name_buffer);
return TRUE;
}
}
@@ -1129,7 +1128,8 @@ gtk_css_tokenizer_read_numeric (GtkCssTokenizer *tokenizer,
else
type = has_sign ? GTK_CSS_TOKEN_SIGNED_DIMENSION : GTK_CSS_TOKEN_SIGNLESS_DIMENSION;
gtk_css_token_init_dimension (token, type, value, gtk_css_tokenizer_read_name (tokenizer));
gtk_css_tokenizer_read_name (tokenizer);
gtk_css_token_init_dimension (token, type, value, tokenizer->name_buffer);
}
else if (gtk_css_tokenizer_remaining (tokenizer) > 0 && *tokenizer->data == '%')
{
@@ -1145,7 +1145,7 @@ gtk_css_tokenizer_read_numeric (GtkCssTokenizer *tokenizer,
else
type = has_sign ? GTK_CSS_TOKEN_SIGNED_NUMBER : GTK_CSS_TOKEN_SIGNLESS_NUMBER;
gtk_css_token_init_number (token, type,value);
gtk_css_token_init_number (token, type, value);
}
}
@@ -1196,7 +1196,8 @@ gtk_css_tokenizer_read_string (GtkCssTokenizer *tokenizer,
GtkCssToken *token,
GError **error)
{
GString *string = g_string_new (NULL);
g_string_set_size (tokenizer->name_buffer, 0);
char end = *tokenizer->data;
gtk_css_tokenizer_consume_ascii (tokenizer);
@@ -1222,23 +1223,22 @@ gtk_css_tokenizer_read_string (GtkCssTokenizer *tokenizer,
}
else
{
g_string_append_unichar (string, gtk_css_tokenizer_read_escape (tokenizer));
g_string_append_unichar (tokenizer->name_buffer, gtk_css_tokenizer_read_escape (tokenizer));
}
}
else if (is_newline (*tokenizer->data))
{
g_string_free (string, TRUE);
gtk_css_token_init (token, GTK_CSS_TOKEN_BAD_STRING);
gtk_css_tokenizer_parse_error (error, "Newlines inside strings must be escaped");
return FALSE;
}
else
{
gtk_css_tokenizer_consume_char (tokenizer, string);
gtk_css_tokenizer_consume_char (tokenizer, tokenizer->name_buffer);
}
}
gtk_css_token_init_string (token, GTK_CSS_TOKEN_STRING, g_string_free (string, FALSE));
gtk_css_token_init_string (token, GTK_CSS_TOKEN_STRING, tokenizer->name_buffer);
return TRUE;
}
@@ -1322,9 +1322,8 @@ gtk_css_tokenizer_read_token (GtkCssTokenizer *tokenizer,
else
type = GTK_CSS_TOKEN_HASH_UNRESTRICTED;
gtk_css_token_init_string (token,
type,
gtk_css_tokenizer_read_name (tokenizer));
gtk_css_tokenizer_read_name (tokenizer);
gtk_css_token_init_string (token, type, tokenizer->name_buffer);
}
else
{
@@ -1404,9 +1403,8 @@ gtk_css_tokenizer_read_token (GtkCssTokenizer *tokenizer,
gtk_css_tokenizer_consume_ascii (tokenizer);
if (gtk_css_tokenizer_has_identifier (tokenizer))
{
gtk_css_token_init_string (token,
GTK_CSS_TOKEN_AT_KEYWORD,
gtk_css_tokenizer_read_name (tokenizer));
gtk_css_tokenizer_read_name (tokenizer);
gtk_css_token_init_string (token, GTK_CSS_TOKEN_AT_KEYWORD, tokenizer->name_buffer);
}
else
{
+15 -2
View File
@@ -81,7 +81,11 @@ typedef struct _GtkCssDimensionToken GtkCssDimensionToken;
struct _GtkCssStringToken {
GtkCssTokenType type;
char *string;
int len;
union {
char buf[16];
char *string;
} u;
};
struct _GtkCssDelimToken {
@@ -97,7 +101,7 @@ struct _GtkCssNumberToken {
struct _GtkCssDimensionToken {
GtkCssTokenType type;
double value;
char *dimension;
char dimension[8];
};
union _GtkCssToken {
@@ -108,6 +112,15 @@ union _GtkCssToken {
GtkCssDimensionToken dimension;
};
static inline const char *
gtk_css_token_get_string (const GtkCssToken *token)
{
if (token->string.len < 16)
return token->string.u.buf;
else
return token->string.u.string;
}
void gtk_css_token_clear (GtkCssToken *token);
gboolean gtk_css_token_is_finite (const GtkCssToken *token) G_GNUC_PURE;
-1
View File
@@ -1,5 +1,4 @@
gtk_css_public_sources = files([
'gtkcsslocation.c',
'gtkcsserror.c',
'gtkcsssection.c',
])
+1 -1
View File
@@ -320,7 +320,7 @@ gtk_app_chooser_button_ensure_dialog_item (GtkAppChooserButton *self,
gtk_list_store_insert_after (self->store, &iter, &iter2);
real_insert_custom_item (self, CUSTOM_ITEM_OTHER_APP,
_("Other application"), NULL,
_("Other app…"), NULL,
FALSE, &iter);
}
+5 -5
View File
@@ -522,7 +522,7 @@ gtk_app_chooser_add_default (GtkAppChooserWidget *self,
gboolean unref_icon;
unref_icon = FALSE;
string = g_strdup_printf ("<b>%s</b>", _("Default Application"));
string = g_strdup_printf ("<b>%s</b>", _("Default App"));
gtk_list_store_append (self->program_list_store, &iter);
gtk_list_store_set (self->program_list_store, &iter,
@@ -572,7 +572,7 @@ update_no_applications_label (GtkAppChooserWidget *self)
if (self->content_type)
desc = g_content_type_get_description (self->content_type);
string = text = g_strdup_printf (_("No applications found for “%s”."), desc);
string = text = g_strdup_printf (_("No apps found for “%s”."), desc);
g_free (desc);
}
else
@@ -655,7 +655,7 @@ gtk_app_chooser_widget_real_add_items (GtkAppChooserWidget *self)
if (self->content_type)
recommended_apps = g_app_info_get_recommended_for_type (self->content_type);
apps_added |= gtk_app_chooser_widget_add_section (self, _("Recommended Applications"),
apps_added |= gtk_app_chooser_widget_add_section (self, _("Recommended Apps"),
show_headings,
!self->show_all, /* mark as recommended */
FALSE, /* mark as fallback */
@@ -670,7 +670,7 @@ gtk_app_chooser_widget_real_add_items (GtkAppChooserWidget *self)
if (self->content_type)
fallback_apps = g_app_info_get_fallback_for_type (self->content_type);
apps_added |= gtk_app_chooser_widget_add_section (self, _("Related Applications"),
apps_added |= gtk_app_chooser_widget_add_section (self, _("Related Apps"),
show_headings,
FALSE, /* mark as recommended */
!self->show_all, /* mark as fallback */
@@ -684,7 +684,7 @@ gtk_app_chooser_widget_real_add_items (GtkAppChooserWidget *self)
{
all_applications = g_app_info_get_all ();
apps_added |= gtk_app_chooser_widget_add_section (self, _("Other Applications"),
apps_added |= gtk_app_chooser_widget_add_section (self, _("Other Apps"),
show_headings,
FALSE,
FALSE,
+2 -2
View File
@@ -59,8 +59,8 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
* ## GtkComboBoxText as GtkBuildable
*
* The `GtkComboBoxText` implementation of the `GtkBuildable` interface supports
* adding items directly using the <items> element and specifying <item>
* elements for each item. Each <item> element can specify the id
* adding items directly using the `<items>` element and specifying `<item>`
* elements for each item. Each `<item>` element can specify the id
* corresponding to the appended text and also supports the regular
* translation attributes translatable, context and comments.
*
+32
View File
@@ -169,6 +169,8 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
* # Accessibility
*
* `GtkDialog` uses the %GTK_ACCESSIBLE_ROLE_DIALOG role.
*
* Deprecated: 4.10: Use [class@Gtk.Window] instead
*/
typedef struct _ResponseData ResponseData;
@@ -511,6 +513,8 @@ gtk_dialog_class_init (GtkDialogClass *class)
* delete event, and when [method@Gtk.Dialog.response] is called.
* On a delete event, the response ID is %GTK_RESPONSE_DELETE_EVENT.
* Otherwise, it depends on which action widget was clicked.
*
* Deprecated: 4.10: Use [class@Gtk.Window] instead
*/
dialog_signals[RESPONSE] =
g_signal_new (I_("response"),
@@ -530,6 +534,8 @@ gtk_dialog_class_init (GtkDialogClass *class)
* This is a [keybinding signal](class.SignalAction.html).
*
* The default binding for this signal is the Escape key.
*
* Deprecated: 4.10: Use [class@Gtk.Window] instead
*/
dialog_signals[CLOSE] =
g_signal_new (I_("close"),
@@ -561,6 +567,8 @@ gtk_dialog_class_init (GtkDialogClass *class)
* g_object_get (settings, "gtk-dialogs-use-header", &header, NULL);
* dialog = g_object_new (GTK_TYPE_DIALOG, header, TRUE, NULL);
* ```
*
* Deprecated: 4.10: Use [class@Gtk.Window] instead
*/
g_object_class_install_property (gobject_class,
PROP_USE_HEADER_BAR,
@@ -690,6 +698,8 @@ gtk_dialog_close (GtkDialog *dialog)
* as described above.
*
* Returns: the new dialog as a `GtkWidget`
*
* Deprecated: 4.10: Use [class@Gtk.Window] instead
*/
GtkWidget*
gtk_dialog_new (void)
@@ -766,6 +776,8 @@ gtk_dialog_new_empty (const char *title,
* ```
*
* Returns: a new `GtkDialog`
*
* Deprecated: 4.10: Use [class@Gtk.Window] instead
*/
GtkWidget*
gtk_dialog_new_with_buttons (const char *title,
@@ -857,6 +869,8 @@ get_response_data (GtkDialog *dialog,
*
* If you want to add a non-activatable widget, simply pack it into
* the @action_area field of the `GtkDialog` struct.
*
* Deprecated: 4.10: Use [class@Gtk.Window] instead
*/
void
gtk_dialog_add_action_widget (GtkDialog *dialog,
@@ -898,6 +912,8 @@ gtk_dialog_add_action_widget (GtkDialog *dialog,
* The button widget is returned, but usually you dont need it.
*
* Returns: (transfer none): the `GtkButton` widget that was added
*
* Deprecated: 4.10: Use [class@Gtk.Window] instead
*/
GtkWidget*
gtk_dialog_add_button (GtkDialog *dialog,
@@ -956,6 +972,8 @@ gtk_dialog_add_buttons_valist (GtkDialog *dialog,
* repeatedly. The variable argument list should be %NULL-terminated
* as with [ctor@Gtk.Dialog.new_with_buttons]. Each button must have both
* text and response ID.
*
* Deprecated: 4.10: Use [class@Gtk.Window] instead
*/
void
gtk_dialog_add_buttons (GtkDialog *dialog,
@@ -983,6 +1001,8 @@ gtk_dialog_add_buttons (GtkDialog *dialog,
*
* Calls `gtk_widget_set_sensitive (widget, @setting)`
* for each widget in the dialogs action area with the given @response_id.
*
* Deprecated: 4.10: Use [class@Gtk.Window] instead
*/
void
gtk_dialog_set_response_sensitive (GtkDialog *dialog,
@@ -1009,6 +1029,8 @@ gtk_dialog_set_response_sensitive (GtkDialog *dialog,
* Sets the default widget for the dialog based on the response ID.
*
* Pressing Enter normally activates the default widget.
*
* Deprecated: 4.10: Use [class@Gtk.Window] instead
*/
void
gtk_dialog_set_default_response (GtkDialog *dialog,
@@ -1037,6 +1059,8 @@ gtk_dialog_set_default_response (GtkDialog *dialog,
* Emits the ::response signal with the given response ID.
*
* Used to indicate that the user has responded to the dialog in some way.
*
* Deprecated: 4.10: Use [class@Gtk.Window] instead
*/
void
gtk_dialog_response (GtkDialog *dialog,
@@ -1060,6 +1084,8 @@ gtk_dialog_response (GtkDialog *dialog,
*
* Returns: (nullable) (transfer none): the @widget button that uses the given
* @response_id
*
* Deprecated: 4.10: Use [class@Gtk.Window] instead
*/
GtkWidget*
gtk_dialog_get_widget_for_response (GtkDialog *dialog,
@@ -1089,6 +1115,8 @@ gtk_dialog_get_widget_for_response (GtkDialog *dialog,
*
* Returns: the response id of @widget, or %GTK_RESPONSE_NONE
* if @widget doesnt have a response id set.
*
* Deprecated: 4.10: Use [class@Gtk.Window] instead
*/
int
gtk_dialog_get_response_for_widget (GtkDialog *dialog,
@@ -1398,6 +1426,8 @@ gtk_dialog_get_action_area (GtkDialog *dialog)
* [property@Gtk.Dialog:use-header-bar] property is %TRUE.
*
* Returns: (type Gtk.HeaderBar) (transfer none): the header bar
*
* Deprecated: 4.10: Use [class@Gtk.Window] instead
*/
GtkWidget *
gtk_dialog_get_header_bar (GtkDialog *dialog)
@@ -1416,6 +1446,8 @@ gtk_dialog_get_header_bar (GtkDialog *dialog)
* Returns the content area of @dialog.
*
* Returns: (type Gtk.Box) (transfer none): the content area `GtkBox`.
*
* Deprecated: 4.10: Use [class@Gtk.Window] instead
*/
GtkWidget *
gtk_dialog_get_content_area (GtkDialog *dialog)
@@ -27,6 +27,8 @@
#include "gtkalertdialog.h"
#include <glib/gi18n-lib.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
typedef struct {
GtkWindow *parent;
GAppLaunchContext *context;
@@ -96,6 +98,9 @@ window_handle_exported (GtkWindow *window,
*
* This is the recommended call to be used as it passes information
* necessary for sandbox helpers to parent their dialogs properly.
*
* Deprecated: 4.10: Use [method@Gtk.FileLauncher.launch] or
* [method@Gtk.UriLauncher.launch] instead
*/
void
gtk_show_uri_full (GtkWindow *parent,
@@ -142,6 +147,9 @@ gtk_show_uri_full (GtkWindow *parent,
*
* Returns: %TRUE if the URI was shown successfully.
* Otherwise, %FALSE is returned and @error is set
*
* Deprecated: 4.10: Use [method@Gtk.FileLauncher.launch_finish] or
* [method@Gtk.UriLauncher.launch_finish] instead
*/
gboolean
gtk_show_uri_full_finish (GtkWindow *parent,
@@ -184,6 +192,9 @@ show_uri_done (GObject *object,
*
* This function launches the default application for showing
* a given uri, or shows an error dialog if that fails.
*
* Deprecated: 4.10: Use [method@Gtk.FileLauncher.launch] or
* [method@Gtk.UriLauncher.launch] instead
*/
void
gtk_show_uri (GtkWindow *parent,
+3 -3
View File
@@ -29,7 +29,7 @@
G_BEGIN_DECLS
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_4_10_FOR(gtk_file_launcher_launch)
void gtk_show_uri_full (GtkWindow *parent,
const char *uri,
guint32 timestamp,
@@ -37,12 +37,12 @@ void gtk_show_uri_full (GtkWindow *parent,
GAsyncReadyCallback callback,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_4_10_FOR(gtk_file_launcher_launch)
gboolean gtk_show_uri_full_finish (GtkWindow *parent,
GAsyncResult *result,
GError **error);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_4_10_FOR(gtk_file_launcher_launch)
void gtk_show_uri (GtkWindow *parent,
const char *uri,
guint32 timestamp);
+2 -2
View File
@@ -47,8 +47,8 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
* ## GtkTreeStore as GtkBuildable
*
* The GtkTreeStore implementation of the `GtkBuildable` interface allows
* to specify the model columns with a <columns> element that may contain
* multiple <column> elements, each specifying one model column. The type
* to specify the model columns with a `<columns>` element that may contain
* multiple `<column>` elements, each specifying one model column. The type
* attribute specifies the data type for the column.
*
* An example of a UI Definition fragment for a tree store:
-14
View File
@@ -4395,7 +4395,6 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget,
GList *first_column, *last_column;
gboolean has_can_focus_cell;
gboolean rtl;
int n_visible_columns;
int expander_size;
gboolean draw_vgrid_lines, draw_hgrid_lines;
GtkStyleContext *context;
@@ -4455,14 +4454,6 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget,
|| priv->grid_lines == GTK_TREE_VIEW_GRID_LINES_BOTH;
expander_size = gtk_tree_view_get_expander_size (tree_view);
n_visible_columns = 0;
for (list = priv->columns; list; list = list->next)
{
if (!gtk_tree_view_column_get_visible (GTK_TREE_VIEW_COLUMN (list->data)))
continue;
n_visible_columns ++;
}
/* Find the last column */
for (last_column = g_list_last (priv->columns);
last_column &&
@@ -4487,7 +4478,6 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget,
do
{
gboolean is_separator = FALSE;
int n_col = 0;
parity = !parity;
is_separator = row_is_separator (tree_view, &iter, NULL);
@@ -4537,7 +4527,6 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget,
if (!gtk_tree_view_column_get_visible (column))
continue;
n_col++;
width = gtk_tree_view_column_get_width (column);
if (cell_offset > clip.x + clip.width ||
@@ -6098,7 +6087,6 @@ do_validate_rows (GtkTreeView *tree_view, gboolean queue_resize)
GtkTreePath *path = NULL;
GtkTreeIter iter;
GTimer *timer;
int i = 0;
int y = -1;
int prev_height = -1;
@@ -6208,8 +6196,6 @@ do_validate_rows (GtkTreeView *tree_view, gboolean queue_resize)
else if (prev_height != height)
fixed_height = FALSE;
}
i++;
}
while (g_timer_elapsed (timer, NULL) < GTK_TREE_VIEW_TIME_MS_PER_IDLE / 1000.);

Some files were not shown because too many files have changed in this diff Show More