Timm Bäder
904fd5f1fc
Remove gtk_widget_intersect
...
It's been broken for quite a while now and doesn't make sense anymore
these days.
2018-11-29 11:14:26 +01:00
Timm Bäder
c17c18f1ae
widget: Remove one translate_coordinates copy
...
Just use the double version in the integer version.
2018-11-29 07:39:11 +01:00
Timm Bäder
eebb849760
widget: Query CSS values later in size_allocate
...
Move it below the "this widget only changed its position" check.
2018-11-27 06:00:30 +01:00
Timm Bäder
f92745aacf
widget: Save baseline without CSS values applied
...
Similar to what we do with width/height.
2018-11-27 05:59:47 +01:00
Timm Bäder
b7963a06ab
widget: Parent widgets may also consume motions
...
This is important when the target widget of an event is not the one that
would otherwise receive the gesture. For example, the GtkSwitch
implementation currently attaches a pan gesture to the switch itself,
but the target widget below the pointer might be the switch slider or
label.
See #1465
2018-11-27 05:37:38 +01:00
Timm Bäder
d76a0feef6
widget: gdk_display_get_monitor can return NULL
...
Fixes #1466
2018-11-20 12:45:18 +01:00
Timm Bäder
c65c6ba11f
widget: Fix size-allocate signal docs
2018-11-13 20:54:18 +01:00
Timm Bäder
ade171a2ed
widget: Don't pass a position to ->size_allocate
...
The values have been 0/0 for a long time now, so just drop the
GtkAllocation argument and replace it with width and height.
2018-11-13 16:28:54 +01:00
Timm Bäder
481a78eee7
widget: Avoid some more ->priv accesses
2018-11-08 05:13:50 +01:00
Timm Bäder
145659af93
widget: Some whitespace fixes
2018-11-08 05:13:50 +01:00
Carlos Garnacho
55b32c8a8f
gtkwidget: Drop obsolete code
...
This path is not being hit anymore, gtkmain.c does handle those events
itself.
2018-10-15 17:39:04 +02:00
Carlos Garnacho
0f4a6bfbf8
gtkeventcontrollerlegacy: Make public
...
And move ::event into it, dropping the GtkWidget::event signal.
2018-10-15 17:39:04 +02:00
Timm Bäder
114efa83c6
widget: Stop adding a legacy event controller
...
The only event signal left is ::event and everything needing that
connects to it directly.
2018-10-11 12:27:56 +02:00
Benjamin Otte
db8474e5b1
inspector: Make controllers page use gtk_list_box_bind_model()
2018-09-16 18:50:17 +02:00
Benjamin Otte
867042f88f
widget: Add gtk_widget_observe_controllers()
...
This mirrors gtk_widget_observe_children() - just that it observes the
controllers, not the children.
2018-09-16 18:50:17 +02:00
Benjamin Otte
dd94129e27
widget: Add gtk_widget_observe_children()
...
This creates a listmodel that tracks a widget's children. Doing so turns
adding/removing children from O(1) to O(N) though, so use with caution.
2018-09-16 18:50:17 +02:00
Benjamin Otte
63e5b827ed
window: Add gtk_window_get_toplevels()
...
This one returns a list of all toplevel windows.
2018-09-16 18:50:17 +02:00
Timm Bäder
ab30850aad
widget: Rename width and height member to {width,height}_request
...
Because that's much closer to the meaning of those values.
2018-08-05 10:22:11 +02:00
Benjamin Otte
50d5666db0
container: Remove focus chains
...
They're prectically unused.
Widgets who want to influcence the focus chain behavior should implement
GtkWidgetClass::focus and deal with focus there.
2018-07-31 22:34:27 +02:00
Timm Bäder
480a2c2770
widget: Remove another ->priv usage
2018-07-17 17:33:47 +02:00
Matthias Clasen
7a1073c3ae
Revert "gdk: Drop configure events"
...
This reverts commit a8926c9d87
.
2018-07-15 20:23:45 -04:00
Matthias Clasen
7ca6440f4d
gdk: Drop map events
...
We are really inconsistent about generating these,
and they are not actually used in GTK+. Instead,
add a boolean GdkSurface::mapped property.
2018-07-15 15:10:56 -04:00
Matthias Clasen
da3aaf39b9
gdk: Drop expose events
...
Replace expose events with a GdkSurface::expose signal.
This is part of the move to use events only for input.
2018-07-15 13:13:07 -04:00
Matthias Clasen
a8926c9d87
gdk: Drop configure events
...
Replace configure events with a GdkSurface::size-changed signal.
This is part of the move to use events only for input.
2018-07-15 11:51:09 -04:00
Benjamin Otte
a7cd1918a8
widgetpaintable: Add a hack to make recursion not infloop
...
Makes the GUADEC talk not crash that I'm supposed to give in 20 minutes.
2018-07-13 14:56:04 +02:00
Benjamin Otte
bcfd1bbd24
widgetpaintable: Redo implementation
...
Instead of instantly invalidating, we now cache the old render node and
do the update in an idle handler.
While that gives us a 1 frame delay, it avoids all the tricky things
like queueing resizes while resizing or queueing draws while drawing.
The only remaining issue (and a *big* one at that) is that a nested
widget paintable will now cause the widget to snapshot its previous
render node when creating a new one. And that one will snapshot its
previous render node, and that one will...
And nothing so far breaks this recursion.
2018-07-13 14:56:04 +02:00
Timm Bäder
a6920855ea
Implement GtkInspectorLayoutOverlay
...
To properly replace the old "show layout borders" option.
2018-07-08 11:26:12 +02:00
Matthias Clasen
12464731f1
Merge branch 'dnd-cleanups' into 'master'
...
Dnd cleanups
See merge request GNOME/gtk!226
2018-07-02 21:19:45 +00:00
Matthias Clasen
7733f646d6
gdk: Rename GdkDragContext to GdkDrag
...
This is to go along with the newly introduced GdkDrop.
This commit includes the necessary updates to the X11, Wayland
and Broadway backends. Other backends have to be updated separately.
2018-07-02 14:59:26 +02:00
Benjamin Otte
f3c670ab0c
widget: Move opactiy == 0 check
...
If we check it too early, we will not unset priv->draw_neeeded, which
will then cause queue_draw() calls to not have an effect later. And that
causes changes in opacity to not register.
Closes #1180
2018-06-27 21:50:07 +02:00
Emmanuele Bassi
73d736d800
Do not modify a const GdkEvent in place
...
When deciding whether or not to emulate a press event, we're translating
the last event coordinates and mutating the given event structure
unconditionally.
We should modify the newly created GdkEvent copy, since it's what we're
going to use when emitting the press event.
This avoids mutating a constant GdkEvent and global state, and also
avoids a compiler warning.
2018-06-26 18:06:23 +01:00
Matthias Clasen
8755d884f3
Remove a lot of Since annotations
...
4.0 will represent a clean epoch. We don't want to have
lots of noise in the docs about 2.x or 3.x.
2018-06-25 19:55:04 -04:00
Matthias Clasen
87532f0ac3
Merge branch 'wip/carlosg/issue-1159' into 'master'
...
Fix issue 1159
Closes #1159
See merge request GNOME/gtk!202
2018-06-19 16:40:39 +00:00
Carlos Garnacho
de30a74cdf
gtkwidget: Avoid doubly coordinate conversion when emulating press
...
We are poking again into the event propagation machinery, which
expects events in toplevel coordinates. Since we can't fetch the
original event back at this point, translate the coordinates
back to the toplevel so the emulated press ends up in the right
place.
https://gitlab.gnome.org/GNOME/gtk/issues/1159
Closes : #1159
2018-06-19 13:47:26 +02:00
Benjamin Otte
9a91d3739d
widget: Remove time argument from drag_data_get() vfunc
2018-06-18 23:49:53 +02:00
Benjamin Otte
b00609c21c
dnd: Make drag-motion and drag-drop signals use GdkDrop
2018-06-18 23:49:52 +02:00
Benjamin Otte
6d7cb2b781
dnd: Make drag-data-received use a GdkDrop
2018-06-18 23:49:52 +02:00
Benjamin Otte
314eaf7d10
widget: Make GtkWidgetClass::drag_leave() take a GdkDrop
...
Drag Contexts are on their way out!
2018-06-18 23:49:20 +02:00
Benjamin Otte
5b0a6a52c1
dnd: Get rid of gtk_drag_finish()
...
It's just a wrapper around gdk_drag_finish(), so use that one instead.
2018-06-18 23:49:20 +02:00
Timm Bäder
218b39fe01
GtkStyleContext: Remove the frame clock
...
It's unused within GtkStyleContext.
2018-06-18 17:35:03 +02:00
Timm Bäder
cfbba2c710
widget: Use priv pointer less
...
Instead declare a priv local. We should do this even if we don't remove
the priv pointer from GtkWidget entirely, just to stay consistent with
new code we introduce.
2018-06-09 21:25:15 +02:00
Timm Bäder
758137b5d9
widget: Add docs for {get,set}_focus_child
...
With get_ being still private.
2018-06-04 21:58:44 +02:00
Mohammed Sadiq
f4c1a40446
widget: Fix example code in doc
2018-05-31 16:24:00 +05:30
Matthias Clasen
8746322d53
Drop the ::key-press/release-event signals
...
These are the last event-type specific signals,
we are just relying on the generic ::event signal now.
2018-05-21 20:20:55 -04:00
Matthias Clasen
287c900bdb
Remove key-press-event from more docs
...
This signal will be going away, so stop mentioning it so much.
2018-05-19 23:36:01 -04:00
Timm Bäder
3edd24fb01
widget: Properly remove event controllers in finalize
...
We were mutating the list while iterating over it. This was not a
problem before since remove_controller just set the controller pointer
to NULL instead of actually removing it from the list of controllers.
2018-05-19 23:03:32 +02:00
Timm Bäder
0aad5da1b3
widget: Remove controller sequence-state-changed signal connection
...
We can avoid a signal connection per event controller (and the
EventControllerData struct) since every event controller knows the
widget it's attached to.
2018-05-19 10:18:50 +02:00
Timm Bäder
5ff4ef14e6
widget: Directly notify gestures of grab
...
Since each widget has a list of event controllers now, we don't need to
connect to ::grab-notify of the widget for every controller.
2018-05-19 10:18:50 +02:00
Timm Bäder
f13cccd042
widget: Fix measure docs
...
Fix a typo and don't ever pass NULL to a ::measure() implementation.
2018-05-19 10:18:50 +02:00
Mohammed Sadiq
33bacb4150
widget: Avoid an unnecessary check
...
The preceding loop terminates when either the widget is NULL,
or if their type matches. There is no reason to check that again
2018-05-11 16:09:38 +05:30