Commit Graph

50658 Commits

Author SHA1 Message Date
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
Carlos Garnacho
5836beee78 gtkbutton: Handle crossing events without the event window
The event shall no longer be "directed" to the event window, but the
widget. Getting a enter/leave event is enough now to know whether the
pointer is inside or outside the widget.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
23d2126729 gtkpointerfocus: Add methods to handle implicit grabs on widgets
Just a basic setter/getter, plus a method to obtain the right logical target
in the presence or absence of these.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
3dfab962fa gtk: Implement per-focus implicit grabs
Unlike GTK+ grabs which are global to all/one device, the implicit grab
is per focus, which means each may have implicit grabs on different or
the same widget.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
79e267a330 gtk: Implement cursor updates
As we don't obey GdkWindow cursors anymore, someone must set those.
Use the private Gtkwidget API at the moment.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
8f24df1c19 gtk: Update GtkPointerFocus targets on mapping/sensitivity changes
Those are situations that must cause foci on these widgets to repick
themselves.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
f57f48d61f gdkwindow: Drop csw-side event translation
Now that gtk_main_do_event() is able to handle pointing events in toplevel
coordinates, forward all of these as is. Just minimal handling is still done
on the gdk side for GDK grab accounting, and toplevel tracking for each
pointer.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
e25fcf983a gtk: Handle events with coordinates in toplevel-relative ones
Implement target finding per-pointer/touchpoint through GtkPointerFocus and
_gtk_toplevel_pick(). Focus changes are handled through the emission of
crossing events between the old target and the new one.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
17aa0ca76e gtkwindow: Add management functions for GtkPointerFocus instances
Each toplevel will keep its own tracking of the current ongoing foci,
add the plumbing that will allow to create/update/remove those as they
come and go.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
ba92dceab2 gtk: Introduce GtkPointerFocus
These objects (tied to a toplevel) track the focus of a pointer/touchpoint.
The info in these basically consists of current toplevel coordinates and the
current target widget.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
f50875f8d0 gtkwidget: Expose gtk_widget_common_ancestor()
This function will be useful in other places, such as determining the
widgets that must receive crossing events after pointer picking points
to another widget.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
799428aaea gdk: Add gdk_event_set_coords() method
A helper function basically for gtk+, so coordinates can be translated
in place depending on the widget it's being delivered to.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
53c297436d gtk: Add private _gtk_toplevel_pick() method
This function returns both the widget at the given toplevel coordinates,
and the translated x/y in widget relative coordinates.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
9c97bf0c02 GtkWidget: Add ::pick vmethod
The default implementation iterates through all children, so should suffice
for most widgets.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
fee289cd06 gdk: Add gdk_rectangle_contains_point() call
A little helper function for a somewhat common operation.
2017-05-25 16:25:58 +02:00
Debarshi Ray
28f8a27d65 wayland: Don't abort when preparing the source if connection is lost
Aborting the application makes it look like an application bug, when
it is the expected thing to do when the Wayland display server goes
way. eg., when the user logs out. The log level is also demoted to
avoid a storm of warnings in the log from all applications whenever
this happens.

This is also what the X11 backend does (see gdk_x_io_error).

https://bugzilla.gnome.org/show_bug.cgi?id=783047
2017-05-25 11:49:37 +02:00
Matthias Clasen
853cba6b1a 3.91.0 2017-05-22 21:42:18 -04:00
Matthias Clasen
ca098bb42a Update a11y test output 2017-05-22 21:42:18 -04:00
Matthias Clasen
c05b317b1e Fix the docs build
gtk-doc behavior changed, it seems, and these options now
cause the build to break.
2017-05-22 17:35:58 -04:00
Robert Ancell
4047a2f53e docs: Fix copy-paste error in gtk_file_chooser_get_extra_widget() doc comment 2017-05-20 13:07:05 +12:00
Lapo Calamandrei
251fe5e664 Adwaita: Avoid accindental border on last treeview header
The :last-child selector supposed to reset the border was
overridden by the :hover selector. This is fixed by moving the
:last-child selector after the overriding one.
Thanks to Sebastian Keller for spotting.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=779078.
2017-05-17 18:14:21 +02:00
Robert Ancell
9981f46e0b EntryBuffer: Don't generate changed events when input is truncated 2017-05-17 09:04:21 +12:00
Ignacio Casal Quinteiro
ed6aa0e6e0 meson: remove duplicated G_ENABLE_DEBUG 2017-05-16 22:50:00 +02:00