Commit Graph

50680 Commits

Author SHA1 Message Date
Carlos Garnacho
da56fae5df gtkmain: Ensure there is a current event handling crossing events
The "current event" will be the real one that is triggering the crossing
notifications, not the synthesized events.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
03a63204c1 gtkmain: Ignore GDK_CROSSING_GRAB/UNGRAB crossing events for picking purposes
Especially with owner_events=TRUE, this doesn't mean anything for picking, as
events will be reported as usual inside the application.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
65de0ebea3 gdk: Make it possible to attach user data to GdkEvents
As event->any.window is the toplevel, this is not useful anymore to
determine the window/widget that is the target for this event. Add
helper functions to attach user data to GdkEvents so the target
widget can be stored on the gtk/ side.

These calls should be made private with the rest of GdkEvent related
API.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
5483b9db2d gtkmain: Avoid doubly propagation of enter/leave events from windowing
Crossing events are already generated when picking the new pointer position,
so we don't have to propagate the windowing crossing event as-is.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
f9924b7e3e gtknotebook: Drop drag_window
It is not necessary anymore to implement tab DnD, since we just render
it on top.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
2c7102b557 gtkiconview: Remove view GdkWindow
It's not necessary anymore for clipping nor receiving events. So just
remove it. The event handling code was expecting events in bin_window
coordinates, and have been updated to relying on widget-relative coords.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
2f6c4ef68d gtkviewport: Remove view window
It is not really necessary for clipping nor receiving events.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
547370651b gtkrevealer: Remove view window
It's not necessary anymore for either clipping or event delivery
2017-05-25 16:25:59 +02:00
Carlos Garnacho
94094611bc gtkpaned: Remove per-child windows
Those are no longer necessary for clipping nor receiving events, so just
remove them.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
ae43ca7e49 gtklayout: Remove widget window
It can be entirely replaced by a clip allocation on the widget.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
fe40abc636 gtkoverlay: Remove per-child windows
They are no longer necessary to do child positioning nor input
handling.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
e2c38ddc22 gtkwidget: Add private set_pass_through() call
We could eventually support pointer-event in CSS here, in the mean
time add this call to replace the GdkWindow API.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
6c47938b00 gtktreeview: Remove header window
It is no longer necessary to overlay the column headers above the
treeview.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
cfd5a76ece gtktreeview: Remove widget window
It can be entirely replaced by setting a proper clip rectangle.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
ea4ee876ec gtkstack: Remove view window
This widget already sets a clip area, so the view window can be safely
removed.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
e342f90a99 gtktoolpalette: Remove child window
This is not necessary for rendering anymore, as the clip is set by the
parent scrolledwindow. It's not necessary either for receiving input
events.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
57d7c34d03 gtkflowbox: Remove child window
This widget correctly sets up a clip, so it is not necessary neither
for rendering nor for receiving input events.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
a595f92b7b gtkwidget: Visually update cursors inside widget when changing cursor 2017-05-25 16:25:59 +02:00
Carlos Garnacho
fa04bf6238 gtkmain: Use window-internal API to update pointer cursors 2017-05-25 16:25:59 +02:00
Carlos Garnacho
599344d428 gtkwindow: Add private API to update pointer cursors 2017-05-25 16:25:59 +02:00
Carlos Garnacho
87c7ca910c gtkscrolledwindows: Remove child windows
Both for the view (compensated by widget clip) and the scrollbar
indicators (just not needed anymore).
2017-05-25 16:25:59 +02:00
Carlos Garnacho
8731ca6ca5 gtkexpander: Remove event window
Detect presses/releases inside the label area instead.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
1858f310aa gtkwindow: Implement window resizing sans-GdkWindow
We can just replace window comparisons with coordinate matching, the
cursor corresponding to edges is now set in a capture-phase motion
handler, as cursors aren't set on GdkWindows anymore.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
d9d0c56eb7 gtktoolitem: Remove gtk_tool_item_set_use_drag_window()
This API call is not necessary anymore, since it's no longer necessary
to receive events.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
072a13d0b7 gtkswitch: Remove event window
It's not necessary anymore to receive input events. The pan gesture has
been set on the capture phase as the child widgets may capture during
bubbling.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
ef1e900a53 gtkmenuitem: Remove input window
It's not necessary anymore to receive events.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
ee13d44622 gtkglarea: Remove input window
It's not necessary to receive events anymore.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
bee6148399 gtkseparatortoolitem: Remove event window
It's not necessary. It wasn't either before, as this widget handles no
events.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
de3e20107a gtkcolorswatch: Remove input window
It's not necessary to receive events anymore.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
8402174d6b gtkcolorplane: Remove event window
It is not necessary anymore to receive events.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
c14e6a5119 gtkrange: Remove event window
This is not necessary anymore to receive input events.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
28b1c9cc3d gtkpathbar: Remove event window
This is not necessary anymore to receive scroll events.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
b7e6bb2241 gtktoolbar: Remove input window
This is not necessary to receive events anymore.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
d6023e9d45 label: Remove selection window
It's no longer needed to receive events while the label is selectable.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
3dd8a4191a gtknotebook: Remove event window on top of tabs
No longer needed.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
95bf1379c0 gtkwindow: Ignore implicit grabs going away if there is no focus
There should be no circumstances where an implicit grab is requested but
no focus exists, there's however circumstances (like windowing grabs taking
input to a different window) where we might get implicit grabs being undone
when then new window didn't create a focus for the pointer itself.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
b7fee9f9d2 gtkwindow: Revoke implicit grabs when activating an explicit one
Only if they fall outside the grab widget, in that case the widget holding
the implicit grab won't be receiving events anymore, so we can just undo
it.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
eaa17b2548 gtkbutton: Make windowless
It is no longer necessary to receive events, so it's relatively straightforward
now to drop.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
a72404dd5a gtk: Mass delete all GtkWidget event mask API
We now rely on toplevels receiving and forwarding all the events
the windowing should be able to handle. Event masks are no longer a
way to determine whether an event is deliverable ot a widget.

Events will always be delivered in the three captured/target/bubbled
phases, widgets can now just attach GtkEventControllers and let those
handle the events.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
ef4f0e5336 gtkwidget: Make gtk_widget_event() Accept pointing events in root coordinates
This function will, at the last minute, ensure the event contains the right
widget-relative coordinates for the widget the event is being emitted to.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
02932bc406 gtkgesture: Drop GdkWindow checks
Those are now needless and wrong, as we get guarantees that handled
events will contain widget-relative coordinates. A side effect is
that these events are very possibly not explicitly sent to the
GdkWindow that implementations expect, any extra checks performed
through gtk_gesture_set_window() will be wrong, so the function has
been dropped entirely.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
2c9678c38f gtkexpander: Drop usage of gtk_gesture_set_window()
It's now meaningless since the gesture will receive the event despite
the input only window.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
f5e02f3a2a gtkcolorplane: Drop usage of gtk_gesture_set_window()
It's now meaningless since the widget will receive the event despite
the input window.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
99e200aa98 gtknotebook: Fix coordinate translation to happen on widget-relative coordinates
This makes notebooks happy again after changing event coordinates to always come in
the widget coordinate system.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
b01a9a6440 gtktextview: Drop GdkWindow checks on events
These are now wrong and prevent the code from running correctly.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
b20f04d18d gtktreeview: Drop gtk_gesture_set_window() API
It is now meaningless and wrong, since GdkWindows aren't used anymore
to determine the event target.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
ca07c11172 gtktextview: Set "text" pointer cursor
This is no longer set through the Gdkwindow, so use private GtkWidget
API.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
322ee63e0c gtkentry: Remove text_area window
And refurbish cursor management to be set on the GtkWidget. The
input window is not needed anymore to receive events either.

This is no longer set through the GdkWindow, so use the private
GtkWidget API.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
7c16bb93b5 gtkwidget: Add private cursor setter/getter
This should be eventually replaced by CSS cursors, but at the moment
it must be handled on the gtk/ side.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
d39afa6011 imcontext: Remove API dependency on GdkWindow
There is now a set_client_widget() to hint the IM about positioning
and whatnot.
2017-05-25 16:25:58 +02:00