Commit Graph

50844 Commits

Author SHA1 Message Date
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
Daniel Boles
ce1098598d Frame: Don’t advise adding .flat class in code
https://bugzilla.gnome.org/show_bug.cgi?id=779653#c33
and this is closer to what gtk-3-22 says anyway.
2017-05-14 11:53:25 +01:00
Daniel Boles
322d9ca550 widget-factory: Use :relief=none, not class .flat
The rest of the ui file follows that convention.
2017-05-13 21:50:22 +01:00
Daniel Boles
8ddadecb57 gtk-demo: ui: Replace leftover uses of Box:expand
commit 5729ea7744 skipped these
2017-05-13 18:39:28 +01:00
Daniel Boles
9e6b59c5f4 demo/toolpalette: Restore ToolItemGroup child prop
…erties clobbered by commit c92b7d4224.
That and its counterpart were for removing :expand and :fill child props
from GtkBox, but they ended up catching these for GtkToolItemGroup too.

While GtkToolItemGroup still has these, we may as well keep demoing them
2017-05-13 18:39:13 +01:00
Lapo Calamandrei
5e8463842a Adwaita: regenerate the css 2017-05-11 15:26:48 +02:00
Lapo Calamandrei
3a1946b076 Adwaita: restyle entry-tag
Fix the sizing and spacing, blue tags for the bright variant,
similar to what gnome-documents was shipping, and inverted gray
tags for the dark variant, not vanishing on hover.
2017-05-11 15:26:20 +02:00
Daniel Boles
9546673d33 testsuite/scrolledwindow: Try non-overlay/non-auto
It was only testing the default configuration, where overlay scrolling
is on and both scrollbars use POLICY_AUTOMATIC. We should also test the
other 3 configurations that are available by including non-overlay
scrollbars and/or those that use POLICY_ALWAYS.

https://bugzilla.gnome.org/show_bug.cgi?id=778853
2017-05-10 22:29:01 +01:00
Daniel Boles
a96c586450 ScrolledWindow: Don’t req size for autohidden bars
POLICY_AUTOMATIC means scrollbars are only shown when needed, i.e. when
the size of the window is not large enough to show the entire child. So
when measuring the preferred size, such scrollbars should be ignored.

But measure() added size for *any* non-overlay scrollbar of the opposite
orientation, e.g. for horizontal size, it added the width of vscrollbar.
So we requested for child + bar, & having enough for child meant that the
policy hid the bar, leaving extra space empty below/right of the child.

Fix this by only adding size for such bars if they use POLICY_ALWAYS.

https://bugzilla.gnome.org/show_bug.cgi?id=778853
2017-05-10 22:29:01 +01:00
Daniel Boles
1a95c259d7 ScrolledWindow: Optimise and clean up measure()
• Only calculate the specified dimension – rather than measuring both &
   discarding the other (which will often be recalculated right after)
 • Only measure a given child scrollbar if it may be visible, not always
 • Move variables into narrowest scopes & otherwise improve readability

https://bugzilla.gnome.org/show_bug.cgi?id=778853
2017-05-10 22:29:01 +01:00
Carlos Garnacho
546433a4b7 gtkclipboard: Fix typo
The standard atom is UTF8_STRING.
2017-05-10 20:36:34 +02:00
Daniel Boles
91f2a310ab testsuite/gtk/scrolledwindow: Fix a copy-paste-o
It measured horizontal size when it needs height, making the test fail.
2017-05-10 19:12:16 +01:00
Emmanuele Bassi
daccf61dcf meson: Use buildtype to determine the debugging flags
Meson has a `--buildtype` option which allows us to avoid defining an ad
hoc `--enable-debug=yes|no|minimum` option ourselves.
2017-05-10 12:03:01 +01:00
Emmanuele Bassi
7ec9c36891 meson: Drop unnecessary link_with
The `declare_dependency()` for GIR does not need a `link_with` argument.
2017-05-10 11:37:40 +01:00
Emmanuele Bassi
0226163269 meson: Build the reftests suite
It does not pass, but at least we can check it.
2017-05-10 11:37:40 +01:00