Commit Graph

35890 Commits

Author SHA1 Message Date
Carlos Garnacho
df30741535 gtkbutton: Drop grab_notify handler
The click gesture already has a ::cancel handler, and does almost
everything it should. Move the last bits and remove the grab_notify
handler.
2020-06-24 20:35:22 +02:00
Carlos Garnacho
762748028a gtkspinbutton: Drop grab_notify handler
The press gesture on the buttons already has a ::cancel handler,
this is redundant.
2020-06-24 20:35:22 +02:00
Carlos Garnacho
f7c5cf137c gtknotebook: Move away from grab_notify
Connect to ::cancel on the relevant gesture instead.
2020-06-24 20:35:22 +02:00
Carlos Garnacho
803103640a gtkwindowhandle: Drop has-grab checks
While it's worth thinking about bringing the "windows can be dragged
with open popovers" behavior back, this does not kick in anymore, nor
should be the way to handle this given all the autoclose surface
semantic changes.
2020-06-24 13:41:28 +02:00
Carlos Garnacho
f401b05e7b gtkwidget: Avoid poking surfaces and events in gtk_widget_list_devices()
This got stuck in ancient times when widgets were windowed, so the devices
in a window to know the devices in that widget would pan out. We do only
want here the devices that are inside the widget, not spread over the
surface, so rewrite this helper function to poke the toplevel foci, and
look they are contained inside the widget.
2020-06-24 11:14:52 +02:00
Carlos Garnacho
42ed8a2748 gtkwidget: Drop _gtk_widget_get_device_surface()
A widget cannot have multiple surfaces anymore, nor needs to
fetch the last event surface as it ought to handle its own.
2020-06-24 10:47:15 +02:00
Carlos Garnacho
f872eb64b5 gtkmain: Drop unused struct field
Grabs are, ironically, not about devices anymore. This struct field
is never set.
2020-06-24 10:47:15 +02:00
Carlos Garnacho
29d054c421 gtkwidget: Remove dead code
This variable got unused over time.
2020-06-24 10:47:15 +02:00
Carlos Garnacho
59a8106373 gdk: Drop supports_multidevice API
Crossing events are now detached from widget state, all tricky consequences
from getting multiple crossing events are now somewhat moot. Resort to sending
all generated crossing events, and drop this barely (ever?) used API.
2020-06-23 23:42:53 +02:00
Carlos Garnacho
c1d90273ca gdk: Drop GDK_SOURCE_ERASER
All tools come from devices with GDK_SOURCE_PEN.
2020-06-23 23:42:53 +02:00
Carlos Garnacho
31b95ce47f gtkmain: Look up transient-for hierarchies to determine modality
Windows that are not modal, but are transient-for a modal window should
still be able to receive and handle events. Inspect the window hierarchy
in those cases, so these windows are handled just like widgets within
the modal dialog.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2851
Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/2850
2020-06-23 23:42:53 +02:00
Carlos Garnacho
4fe608e423 gtkwidget: Cancel all gestures in other groups
When a gesture (group) claims a sequence, all other gesture groups
in the same widget should get cancelled. Not just previously claimed
ones, that shouldn't happen actually.
2020-06-23 23:42:53 +02:00
Matthias Clasen
2cfeb1048c Merge branch 'stringlist' into 'master'
add a public stringlist api

See merge request GNOME/gtk!2134
2020-06-23 20:43:49 +00:00
Matthias Clasen
e8210d5865 Add GtkStringList as public api
This is a list model holding strings, initialized
from a char **. String lists are buildable as well,
and that replaces the buildable support in GktDropDowns.
2020-06-23 16:11:46 -04:00
Matthias Clasen
fff981b220 Merge branch 'wip/jimmac/notebook-legibility' into 'master'
Adwaita: notebook legibility fixes

Closes #2652

See merge request GNOME/gtk!2142
2020-06-23 19:12:52 +00:00
Jakub Steiner
ec54399d89 Adwaita: notebook legibility fixes
- make inactive tabs more legible

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2652
2020-06-23 19:54:54 +02:00
Matthias Clasen
83f22fcce2 Add a few missing includes
These sources are using GtkListStore apis,
but were replying on indirect includes to
get the header. Make this explicit, to prepare
for GtkEntryCompletion losing its tree view
dependencies.
2020-06-23 07:55:53 -04:00
Matthias Clasen
34a12f47f1 entry completion: Drop the Private struct
This is in preparation for porting GtkEntryCompletion
to use GtkListView.
2020-06-23 07:55:38 -04:00
Matthias Clasen
7ff427b456 Merge branch 'drop-entry-completion-actions' into 'master'
entrycompletion: Drop action support

See merge request GNOME/gtk!2136
2020-06-22 22:59:17 +00:00
Matthias Clasen
67a7ad069f entrycompletion: Drop action support
This api has not really been kept up with current
user experiences in popups, and we're better off
just dropping it and letting people do their own
popups if they need custom UI.
2020-06-22 14:43:36 -04:00
Matthias Clasen
53a30eaa12 entry completion: Make keynav work again
Use gtk_widget_prepend_controller to supersede entry keynav
while the popup is open. This fixes selecting completions
with the keyboard - the Enter keypress was ending up
triggering GtkText::activate instead of inserting the
selected completion into the entry.
2020-06-22 12:48:42 -04:00
Matthias Clasen
692cc42e10 Add gtk_widget_prepend_controller
Add a variant of gtk_widget_add_controller that
inserts the controller at the beginning, instead
of the end. This will be used in entry completion
to make sure the entry completion key event handling
supersedes the entry one while the popup is open.

Keep this private for now, until we determine if
it needs to be public api.
2020-06-22 12:47:27 -04:00
Matthias Clasen
9faaa5e8be Fix change notification for event controllers
We were adding event controllers at the end, but
announcing a change at the beginning, in
gtk_widget_add_controller. Fix that by emitting
::items-changed for the position where we actually
inserted the controller.
2020-06-22 12:46:12 -04:00
Matthias Clasen
418bbb2685 entrycompletion: Name the controllers
This helps with debugging.
2020-06-22 12:31:15 -04:00
Matthias Clasen
511e5f39fa filter: Make GtkEveryFilter buildable
Due to an oversight, when multi filters were split into
any and every, any ended up with the listmodel and buildable
implementations, and every didn't get any.

Move the implementations up.
2020-06-21 13:10:18 -04:00
Benjamin Otte
a928ea6c57 sortlistmodel: Look at order
For now, we just look at SORT_ORDER_NONE to bypass any sorting.
2020-06-21 14:17:47 +02:00
Matthias Clasen
62b214ffdf filechooserwidget: Use gtk_drop_down_get_selected_item
This showed up as a test failure when we get NULL as
selected item and then try to unref it. Luckily
get_selected_item is transfer none, so we don't have
to worry about it.
2020-06-21 01:20:05 -04:00
Benjamin Otte
45167d5c0d dropdown: emit notify for selected from the changed callback
Otherwise we don't emit it when the selection itself changes it - for
exaple because the model changed.
2020-06-21 02:23:46 +02:00
Matthias Clasen
0214b98c5e Merge branch 'matthiasc/for-master' into 'master'
misc listview scrolling fixes

See merge request GNOME/gtk!2119
2020-06-20 21:21:29 +00:00
Matthias Clasen
7ff35340ca Merge branch 'drop-down-selected-item' into 'master'
dropdown: Add GtkDropDown:selected-item

Closes #2861

See merge request GNOME/gtk!2120
2020-06-20 18:51:18 +00:00
Matthias Clasen
79b1d24128 Merge branch 'gtk4-arb_fbo' into 'master'
Switch to GL_ARB_framebuffer_object

See merge request GNOME/gtk!2079
2020-06-20 17:12:52 +00:00
Matthias Clasen
ad98e72884 dropdown: Add GtkDropDown:selected-item
This is the same readonly property we have in
GtkSingleSelection.

Fixes: #2861
2020-06-20 13:11:48 -04:00
Matthias Clasen
2842030e59 gridview: Don't assert on a condition that can happen
We are currently not robust against model changes or
widget invalidations, so we can actually end up in
situations where we run out of items here. Handle
the failure a bit more gracefully, by returning NULL.

This is good enough to make scrolling work okish most
of the time. We still need a proper fix to handle
other situations.
2020-06-20 12:11:59 -04:00
Benjamin Otte
7c2d21892f gridview: Compute right amount of items to skip
We only want to skip the remaining items in the current row, not since
the start of the widget.
2020-06-20 12:08:46 -04:00
Matthias Clasen
8511f25b97 editablelabel: Allow to drag text
If we allow editing, we should allow direct drags too.
2020-06-19 15:26:53 -04:00
Matthias Clasen
290611f9ce editablelabel: Accept text drops
This seems natural. If we allow editing, we should
allow drops too.
2020-06-19 15:26:53 -04:00
Matthias Clasen
f054c317ee expander: Remove a pointless return
GtkDropControllerMotion::enter does not expect
a boolean return value, so don't provide one.
2020-06-19 15:26:47 -04:00
Matthias Clasen
9555e611e1 treeexpander: Auto-expand during DND
When hovering over a tree expander during DND,
expand the tree after a timeout. This matches
the behavior of GtkTreeView and GtkExpander.
2020-06-19 15:26:47 -04:00
Matthias Clasen
110c316810 columnview: Increase the autoscroll threshold
With autoscroll during DND, we stop when you hit the edge
of the widget, so a larger threshold makes sense to avoid
hitting the edge by accident.
2020-06-19 15:26:10 -04:00
Matthias Clasen
470a1aabdd columnview: Autoscroll during DND
Use a drop motion controller to autoscroll horizontally
while a drag operation is hovering over the list. The
vertical scrolling is handled by the listview.
2020-06-19 15:26:10 -04:00
Matthias Clasen
b299d62a73 columnview: separate autoscroll from headers
Break out an update_autoscroll() function that can
be used for other things than header DND. It will
be used for autoscroll during DND in the future.
2020-06-19 15:26:10 -04:00
Matthias Clasen
02b293b59c listbase: Don't use adjustments for autoscrolling
Don't consult the adjustments when determining
scroll deltas. It isn't necessary.
2020-06-19 15:26:10 -04:00
Matthias Clasen
c659a231d6 listbase: Increase the autoscroll threshold
With autoscroll during DND, we stop when you hit the edge
of the widget, so a larger threshold makes sense to avoid
hitting the edge by accident.
2020-06-19 15:26:10 -04:00
Matthias Clasen
4e56581222 listbase: Autoscroll during DND
Use a drop motion controller to autoscroll while
a drag operation is hovering over the list.
2020-06-19 15:26:10 -04:00
Matthias Clasen
e8ba16d9c2 listbase: separate autoscroll from rubberband
Break out an update_autoscroll() function that can
be used for other things than rubberbanding. It will
be used for autoscroll during DND in the future.
2020-06-19 15:26:10 -04:00
Matthias Clasen
55936087e0 columview: Fix cell creation
We were getting lost in the columnview internal
structure here. The rows are children of the listview,
not of the columnview itself.
2020-06-19 11:42:58 -04:00
Matthias Clasen
69e14ba02f Revert "notebook: Don't capture clicks"
This reverts commit 37eb0496b6.

This change broke notebook scroll arrows.
2020-06-19 11:42:47 -04:00
Benjamin Otte
ff3b03c5e2 listbase: Fix copy/paste error
This could lead to "flickering" scroll behavior when scrolling
horizontally.
2020-06-19 15:51:52 +02:00
Timm Bäder
fbb7948c13 stack: Avoid using an uninitialized value
This was showing up as criticals since for_size != >= -1.
2020-06-19 05:58:52 +02:00
Timm Bäder
d81a5a8338 stack: Add missing accessors for GtkStackPage properties 2020-06-19 05:26:25 +02:00