Commit Graph

35413 Commits

Author SHA1 Message Date
Carlos Garnacho
d29d59d1f9 gtksearchengine: Drop tracker 2.x search engine
This is being superseded by 3.x
2020-05-19 22:05:07 +02:00
Carlos Garnacho
edf6f9e108 gtksearchenginetracker3: Pre-fill GFileInfo from query
Provide the minimal info necessary. Improves apparent responsiveness
(since we don't visibly clear and repopulate the list) and saves doing
file stat/reads on every file in the result set.
2020-05-19 22:05:07 +02:00
Carlos Garnacho
98f376a19e gtksearchengine: Add tracker3 search engine
Make this dependency optional at build time, and prefer it over
the old tracker <= 2.x implementation.
2020-05-19 22:05:07 +02:00
Carlos Garnacho
de68925f0c gtksearchengine: Add autoptr handler for this type
So subclasses can just use G_DECLARE_*_TYPE.
2020-05-19 22:04:25 +02:00
Carlos Garnacho
b890e87818 gtksearchengine: Add "got_results" argument to ::finished
The filechooser tries to figure out whether it got results by poking
the model, but all files might go through the async GFileInfo querying
state.

Make all search engines (and the composite one) just notify about this
fact, so the file chooser can behave appropriately without waiting for
the async operations to finish.
2020-05-19 22:04:25 +02:00
Timm Bäder
db76b52744 treeview: Remove animate parameters
Nothing ever reads them.
2020-05-19 08:32:33 +02:00
Timm Bäder
7235472a58 text: Assert that we have ranges before using them
We never hit this code path otherwise but let's make sure.
2020-05-19 08:32:33 +02:00
Timm Bäder
99871639fe unsetvalue: Add G_GNUC_NORETURN annotation 2020-05-19 08:32:33 +02:00
Timm Bäder
b92f4177aa builder-tool Make preview closeable 2020-05-19 08:32:33 +02:00
Timm Bäder
20b906cee8 Build print backends with common_cflags 2020-05-19 08:32:33 +02:00
Timm Bäder
43ba86b7af tools: Pass common_cflags to executables 2020-05-19 08:32:33 +02:00
Matthias Clasen
383fa6b0b0 Merge branch 'matthiasc/for-master' into 'master'
colorscale: Bring back the right-click on slider

See merge request GNOME/gtk!1933
2020-05-18 16:46:12 +00:00
Matthias Clasen
f637ab57f1 colorscale: Bring back the right-click on slider
This was lost when we converted the color editor to actions.
2020-05-18 11:31:42 -04:00
Jakub Steiner
9be5c7b0c8 Merge branch 'theme-aligned-combo-labels' into 'master'
Adwaita: Align combo menu labels with the combo button label

See merge request GNOME/gtk!1928
2020-05-18 14:04:19 +00:00
nana-4
538ab75002 Adwaita: Align combo menu labels with the combo button label
Apply the same left and right padding to the combo menu items as the
combo button.
2020-05-18 21:52:00 +09:00
nana-4
1c99dbc70e Adwaita: Tweak padding in checkbutton & radiobutton
Since we can now use border-spacing in checkbutton and radiobutton,
we don't need the margin in check and radio for spacing anymore.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2697
2020-05-18 20:29:23 +09:00
Timm Bäder
3c7ba21a6a Add G_GNUC_NORETURN to functions that never return 2020-05-18 11:30:08 +02:00
Matthias Clasen
75d9310986 Change coordinate translation apis to take doubles
Change gtk_widget_translate_coordinates and
gtk_native_get_surface_transform to operate
on doubles. Update all callers.
2020-05-17 17:17:31 -04:00
Matthias Clasen
93d4253c93 native: Make gtk_native_get_surface_transform public
This api is needed to translate between surface
and widget coordinates.
2020-05-17 16:01:08 -04:00
Matthias Clasen
c0faf0c6b6 Merge branch 'toplevel-move-resize' into 'master'
Toplevel move resize

See merge request GNOME/gtk!1923
2020-05-17 19:15:46 +00:00
Benjamin Otte
b353221185 Merge branch 'wip/otte/monitors' into 'master'
various GDK cleanups

See merge request GNOME/gtk!1920
2020-05-17 16:57:52 +00:00
Matthias Clasen
f316fe0f58 window: Use toplevel begin_move/resize api
The GdkSurface api for this is going away.
2020-05-17 12:49:26 -04:00
Timm Bäder
74a1c60dd4 windowhandle: Apply surface transform before passing coords to GDK
Otherwise coordinates are incorrect and the window can jump around after
starting a drag.
2020-05-17 15:30:50 +02:00
Timm Bäder
a4bb81b61c inspector: Apply toplevel transform before snapshotting overlays 2020-05-17 15:30:44 +02:00
Timm Bäder
afbc1d5b66 shortcutmanager: Fix private header include guard 2020-05-17 15:30:03 +02:00
Timm Bäder
1d9e68245a shortcutcontroller: Don't return a shortcut stope as GdkModifierType 2020-05-17 15:30:03 +02:00
Timm Bäder
9b98641ddd window: Use TRUE/FALSE for boolean values 2020-05-17 15:30:03 +02:00
Matthias Clasen
d70feb9165 Apply surface transform in more places
With these fixes, GtkSwitch now works in the presence
of surface transforms.
2020-05-17 02:23:23 -04:00
Matthias Clasen
38af49d4fd inspector: Take surface transform into account 2020-05-17 02:10:56 -04:00
Matthias Clasen
d2913b81cb windowhandle: Take surface transform into account 2020-05-17 02:05:32 -04:00
Matthias Clasen
c90078fd4a widget: Fix gtk_widget_get_surface_allocation
As the name implies, this should be surface-relative
coordinates, so it needs to take the surface transform
into account.
2020-05-17 02:04:22 -04:00
Matthias Clasen
428e647238 textview: Fix context menu placement
Take the surface transform into account for
positioning the context menu.
2020-05-17 02:03:41 -04:00
Benjamin Otte
4c7914dc49 display: Remove unneeded getters
Applications can use the listmodel instead.
2020-05-17 07:32:37 +02:00
Matthias Clasen
5e35a4b69a tooltip: Fix positioning
There are a few more places where we were forgetting
to apply the surface->native transform. With these
changes, tooltips are positioned correctly when
the toplevel has padding applied.

Fixes: #1619
2020-05-17 01:22:02 -04:00
Matthias Clasen
a2a3aab94d Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master

Closes #2601

See merge request GNOME/gtk!1918
2020-05-16 23:35:51 +00:00
Benjamin Otte
0c6266fd1a surface: Remove gdk_surface_is_viewable()
It returns the same value as gdk_surface_get_mapped(), so use that
instead.
2020-05-17 00:41:44 +02:00
Timm Bäder
5b0e91844b popover: Fix input shape rendering
Once again, calling gtk_widget_get_allocation() is wrong.

Fixes #2601
2020-05-16 22:34:38 +02:00
Timm Bäder
ccaacfc8c3 texthandle: Remove min-width/height handling
We do that automatically for all widgets.
2020-05-16 22:04:00 +02:00
Timm Bäder
2e9d772e66 natives: Use GtkCssBoxes in get_surface_transform 2020-05-16 22:04:00 +02:00
Timm Bäder
bac6e79614 native: Add documenation for get_surface_transform 2020-05-16 22:03:58 +02:00
Timm Bäder
2fd86ef80c popover: Return correct values from get_surface_transform()
We do not (yet) care about the box shadow here, so it's sufficient to
return the css values.
2020-05-16 22:03:58 +02:00
Timm Bäder
f9370d7e83 main: Translate coordinates from surface to native before picking
gtk_widget_pick() needs them to be in @self coordinates.
2020-05-16 22:03:55 +02:00
Matthias Clasen
c5b2bbf01b inspector: Use tabular numbers in the fps overlay
It is a lot more readable if it doesn't constantly jitter.
2020-05-15 21:30:14 -04:00
Matthias Clasen
8912a6eb75 gtk: Handle seatless displays
If you run weston with the headless backend, you get a Wayland
display with no seat, which is just fine by the protocol.

gdk_display_get_default_seat() returns NULL in this case. Various
widgets assume that we always have a seat with a keyboard and a
pointer, since that is what X guarantees. Make things survive
without that, so we can run the testsuite under a headless
Wayland compositor.
2020-05-15 14:11:53 -04:00
Corentin Noël
80473ccd69 widget: Add array annotation to set_css_classes
It expects a NULL-terminated array so annotate it.
2020-05-15 12:01:56 +02:00
Jakub Steiner
d7e6fbf8a2 Adwaita: notebook tab focus tweak
Finally fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2721
2020-05-15 09:34:57 +02:00
Alexander Mikhaylenko
5dc6194b98 eventcontrollerscroll: Fix the history push condition
Once upon a time, there was a function called gdk_event_get_scroll_deltas().
It returned %TRUE when an event had scroll deltas and that was used as the
condition to decide whether to push scroll deltas to the scroll history,
even when the both deltas are 0 for the stop event at the end of scrolling.

When GtkScrolledWindow kinetic scrolling code was adapted for
GtkEventControllerScroll, it was replaced with a (dx != 0 && dy != 0)
check. This prevented the stop event from getting into the history, and
instead allowed non-smooth scrolling to affect the history as they have
synthetic deltas with one of the values being -1 or 1 and the other on 0.

Instead, check the direction as we already have it as a local variable.
2020-05-15 01:32:04 +05:00
Jakub Steiner
dd61c248c1 Adwaita: don't focus outline tabs with mouse
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2721
2020-05-14 18:50:47 +02:00
Alexander Larsson
4ce65f019e GtkDragSource: Pass return value of drag-cancel into drag_end()
This is needed to work as the docs say (don't play fallback cancel animation
if cancel returned TRUE to signal the drop already happened).
2020-05-14 10:44:07 +02:00
Matthias Clasen
69ab403d78 flowbox: Avoid an assertion in snapshot()
The api contract for size_allocate() vfuncs is
that they must allocate all the children that are
going to be snapshotted in snapshot(). The flowbox
size_allocate() was just bailing out when the children
request a size of 0x0, leading to an assertion in
snapshot() vfunc later. Just allocate all children
a size of 0x0 in this case.
2020-05-13 21:47:11 -04:00
Matthias Clasen
33011ccdff flowbox: Avoid a crash in measure()
When the children request a height of zero, the
flowbox measure() function was happily dividing
by that zero, leading to badness.
2020-05-13 21:47:11 -04:00
Matthias Clasen
7915e998e2 listbox: Make Shift-Tab work again
The previous fix broke the case where we're Shift-Tabbing
from a listboxrow child to the row itself. This was causing
the widget-factory2.tab-backward test to fail. Fix it, by
grabbing the focus to the row explicitly.
2020-05-13 21:45:49 -04:00
Matthias Clasen
7ef51da1c1 listbox: Don't steal focus-on-click
If a row has content that is focus-on-click, and is set
to focus-on-click itself, then the row steals the focus
fromt he content, since it uses focus-on-click on button
release, as opposed to button press. Avoid that by
refusing to take focus if it is already on some
descendent of the row.

This was showing up in the widget-factory listbox on
page 2, where clicking on the spinbutton would briefly
put the focus on the spinbutton, only to lose it to
the row.
2020-05-13 19:43:04 -04:00
Matthias Clasen
4c8688b846 inspector: Disable recursive inspection
We can't inspect the inspector, it doesn't work.
Therefore, disable the keybindings in the
inspector window.
2020-05-13 18:56:25 -04:00
Matthias Clasen
cea66139ae flowbox: Make the children focusable again
This broke when the :focusable property was introduced.
The symptom was that keynav in the Emoji chooser did
not work anymore.
2020-05-13 18:27:18 -04:00
Matthias Clasen
10be40a8b1 scrolledwindow: Fix swapping out child
This was not working in the case that the existing child
is not a scrollable. It showed up as crashes of the
scrolling benchmark in gtk4-demo when switching examples.
2020-05-13 17:10:36 -04:00
Matthias Clasen
d1134e7616 Merge branch 'usable-scales' into 'master'
Usable scales

See merge request GNOME/gtk!1893
2020-05-13 20:06:51 +00:00
Matthias Clasen
aae0770b82 scale: Make the area around the trough clickable
The narrow trough is too hard to hit as a click target.
Make the entire scale clickable.
2020-05-13 15:27:35 -04:00
Jakub Steiner
69ee1e1b86 Adwaita: use thinner arrows for navigation
- go-next go-previous instead of pan-end pan-start

See https://gitlab.gnome.org/GNOME/gtk/-/issues/2675
2020-05-13 17:18:45 +00:00
Matthias Clasen
fa784aaa06 Cosmetics 2020-05-13 08:11:50 -04:00
Timm Bäder
9149c79f25 window: Restructure gtk_window_destroy()
The previous code was unreffing the window twice, which caused problems
during dialog destruction. Move to g_list_store_find instead of
iterating manually.

ref() the window before and unref() after. g_list_store_remove will
actually unref() the window, since the toplevel_list owns its own
reference.

Fixes #2741
Fixes #2742
2020-05-13 12:18:09 +02:00
Timm Bäder
a50bf27cf2 main: Inline propagate_{down,up} in propagate_internal()
Don't have to worry about anyone calling the up/down variants on their
own this way.
2020-05-13 11:52:22 +02:00
Timm Bäder
ddaf50dfcc window: Create constraint solver on demand 2020-05-13 11:52:16 +02:00
Timm Bäder
8a7fb4b133 widget: Make 1 if out of 2 ifs 2020-05-13 11:52:07 +02:00
Timm Bäder
9e0bf35941 paned: Fix up the docs once more 2020-05-13 09:42:51 +02:00
Timm Bäder
f78c167476 cssvalue: Add class check to transition
In b25f93e24c we removed the code
comparing the transition functions, but we didn't add any other check
back.

Fixes #2740
2020-05-13 08:07:55 +02:00
Timm Bäder
167c6119eb widget: Move adjusted size calculation below early-out goto 2020-05-13 08:07:55 +02:00
Timm Bäder
ef2af521b1 widget: Remove size allocate signal enum member 2020-05-13 08:07:55 +02:00
Timm Bäder
aedc956f6c renderboder: Ignore transparent outlines 2020-05-13 08:07:55 +02:00
Benjamin Otte
d9c0d98871 inspector: Use the monitor list to list monitors 2020-05-13 07:49:56 +02:00
Matthias Clasen
b230ea2140 paned: Don't ignore the type attribute
We were meaning to only handle <child> here for
compatibility, not <child type="somethingelse">.
2020-05-12 16:27:25 -04:00
Matthias Clasen
a37dc29850 paned: Drop the Private struct 2020-05-12 16:25:58 -04:00
Matthias Clasen
c916221f59 Merge branch 'matthiasc/for-master' into 'master'
printoperation-unix: Fix a use-after-free

See merge request GNOME/gtk!1883
2020-05-12 18:54:59 +00:00
Matthias Clasen
09ea880a43 printoperation-unix: Fix a use-after-free
It turns out that finish_print destroys the
PrintResponseData, so we can't access it afterwards.
2020-05-12 14:09:51 -04:00
Emmanuele Bassi
58774eea72 docs: Add annotations for GtkPaned new getters
Which means also adding gtk-doc stanzas.
2020-05-12 18:52:45 +01:00
Carlos Garnacho
3b9a8194a5 Merge branch 'wip/carlosg/broken-grabs' into 'master'
Fixes to broken grabs

Closes #2665

See merge request GNOME/gtk!1879
2020-05-12 16:14:47 +00:00
Matthias Clasen
fdc9bfa2e9 Merge branch 'matthiasc/for-master' into 'master'
window: Hide windows on destroy

See merge request GNOME/gtk!1881
2020-05-12 15:58:10 +00:00
Carlos Garnacho
9103fd6687 gtkmain: Release the active state on GDK_GRAB_BROKEN
This is handled internally here, but misses broken grabs. The active
state should be dropped just as if the button were released.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2665
2020-05-12 17:39:54 +02:00
Matthias Clasen
ffcffcd773 window: Hide windows on destroy
I thought I could get away with just unrealizing the
window, but it turns out that gtk_window_hide() is the
place where we remove grabs when a modal dialog goes
away, so we ended up with stuck grabs.
2020-05-12 11:10:36 -04:00
Matthias Clasen
450879b1da Merge branch 'matthiasc/for-master' into 'master'
Documentation work

See merge request GNOME/gtk!1880
2020-05-12 14:52:01 +00:00
Emmanuele Bassi
717d4abebb Do not release the GFile prematurely
Otherwise we won't be able to access it to get the URI for the
GtkPrinterOption.

This fixes a regression introduced in commit 5f070ff233.
2020-05-12 13:45:15 +01:00
Emmanuele Bassi
d54b7dec94 Remove gtk_dialog_run()
Nested main loops are bad, as they introduce layers of complexity caused
by the potential re-entrancy in the case of multiple event sources, like
IPC, threads, etc. Additionally, the programming model they provide—stop
the world while spinning a new loop—does not conform to the event-driven
model employed by GTK.
2020-05-12 13:45:15 +01:00
Emmanuele Bassi
0a6848d70b Remove gtk_dialog_run() from GtkPrintUnixDialog
Replace it with an explicit nested main loop, as we need to block the
signal handler currently being emitted depending on the response of the
overwrite confirmation dialog.

This is a bit of a hack, and the only reason we need it is that the
print dialog will load the last used path as the output file name, when
printing to a file; this means that, in theory, it would be possible to
press Print without selecting a file, and accidentally overwriting an
existing file.

It would be much simpler if we did not store the last used path, and
always explicitly asked the user to select a file; this would avoid
destructive actions, and would allow us to rely on the overwrite
confirmation dialog right inside the file chooser.
2020-05-12 13:45:15 +01:00
Emmanuele Bassi
b8988be4b5 Remove unnecessary deprecation pragmas
The gtk_window_present() function is not deprecated.
2020-05-12 13:45:15 +01:00
Emmanuele Bassi
45eec06500 Drop gtk_dialog_run() from GtkPrintOperationUnix
We still provide a blocking API, but we should strongly reconsider it.
2020-05-12 13:45:15 +01:00
Emmanuele Bassi
96856527e6 Drop gtk_dialog_run() from GtkFileChooserWidget
The various dialogs we use inside the file chooser are modal already,
and do no need a nested loop.
2020-05-12 13:22:09 +01:00
Emmanuele Bassi
f81e6042be docs: Remove use of gtk_dialog_run()
Direct people to use GTK_DIALOG_MODAL and the "response" signal instead
of nested main loops.
2020-05-12 13:18:38 +01:00
Emmanuele Bassi
5d272a12cb Remove gtk_native_dialog_run()
Nested main loops are bad, as they introduce layers of complexity caused
by the potential re-entrancy in the case of multiple event sources, like
IPC, threads, etc. Additionally, the programming model they provide—stop
the world while spinning a new loop—does not conform to the event-driven
model employed by GTK.
2020-05-12 13:15:19 +01:00
Emmanuele Bassi
3212b07cf1 docs: Remove use of gtk_native_dialog_run() from examples
Use the "response" signal instead.
2020-05-12 13:15:19 +01:00
Emmanuele Bassi
f573a1f3f2 Remove gtk_dialog_run() from GtkMountOperation 2020-05-12 13:15:16 +01:00
Carlos Garnacho
fbd0c8dc34 gtkmain: Propagate GDK_GRAB_BROKEN events to/from current focus
Let keyboard/pointer paths handle their own events, and find the
current focus. The event will be propagated through instead of
being just emitted on the toplevel.

This makes it handled throughout all the gestures that want to
know about it.
2020-05-12 14:14:39 +02:00
Carlos Garnacho
5e765eaac4 gtktexthandle: Set css name on GtkWidgetClass
Handles are their own widget, special names are not necessary
anymore.
2020-05-12 14:14:39 +02:00
Matthias Clasen
d8db984890 docs: Tweaks
Replace some occurrences of GTK+ by GTK.
2020-05-12 07:50:12 -04:00
Matthias Clasen
7ef173aa34 dialog: Firm up handling of action widgets
It is unreliable to use the widget dom api to locate
action widgets. For example in a headerbar, they might
be deeper in the hierarchy, with boxes in between.
Therefore, make GtkDialog keep a list of action widgets,
and use that when operating on action widgets.
2020-05-11 22:38:21 -04:00
Matthias Clasen
f72d672434 dialog: Remove an unused struct 2020-05-11 22:38:21 -04:00
Matthias Clasen
5ebd42d402 Drop GtkContainer and its accessible implementation
It is no longer used.
2020-05-11 22:38:21 -04:00
Matthias Clasen
5573a3465c Drop gtkcontainer.h includes
These includes are unused.
2020-05-11 22:38:21 -04:00
Matthias Clasen
5f642f8096 box: Derive from GtkWidget 2020-05-11 22:38:21 -04:00
Matthias Clasen
6bc4446e3e assistant: Remove code that doesn't work anymore
When GtkContainer goes away, we don't have
an "add" signal anymore.
2020-05-11 22:38:21 -04:00
Matthias Clasen
6c78eeebe4 dialog: Remove code that doesn't work anymore
When GtkContainer goes away, we don't have an
"add" signal anymore.
2020-05-11 22:38:21 -04:00