Commit Graph

28208 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Jonas Ådahl
477556aac2 GtkWindow: Don't double free export user data
The user data passed when exporting a Wayland window was supposed to be
freed using the destroy_func, as is commonly done. This was previously
broken, as the user data was just NULL:ed when exported, and only
actually destroyed when unexporting before having exported.

While e016d9a5db fixed this, it introduced
a regression, as GtkWindow was nice enough to free the memory anyway
after having received the exported handle, causing it now to double
free.

https://bugzilla.gnome.org/show_bug.cgi?id=782109
2017-05-09 23:23:11 +08:00
Lapo Calamandrei
28d8fdca02 Adwaita: regenerate the css 2017-05-09 13:39:05 +02:00
Lapo Calamandrei
ebcf17debd Adwaita: add a comment
Add a comment pointing to the related bug for dropdown menu
margin.
2017-05-09 13:38:03 +02:00
Lapo Calamandrei
e9ee313be2 Revert "Adwaita: remove unneeded margin on dropdown menu"
This reverts commit af76e138f9.
The margin was actually related to:
https://bugzilla.gnome.org/show_bug.cgi?id=591258
2017-05-09 13:34:49 +02:00
Lapo Calamandrei
78d4854d10 Adwaita: regenerate css 2017-05-09 12:48:12 +02:00
Lapo Calamandrei
af76e138f9 Adwaita: remove unneeded margin on dropdown menu
That margin was probably a left over to workaround some placement
issue on dropdowns which doesn't exist anymore.
2017-05-09 12:48:12 +02:00
Olof-Joachim Frahm
621d1bb4ec Make sure to remove tooltip timeout.
Otherwise in GC-ed environments the `g_source_remove` call during
disposal might be called on an already removed source, which results in
unnecessary console output.

https://bugzilla.gnome.org/show_bug.cgi?id=778301
2017-05-08 18:05:21 -04:00
Jakub Steiner
dee666f515 style entry-tags
https://bugzilla.gnome.org/show_bug.cgi?id=781214
2017-05-08 17:55:03 -04:00
Matthias Clasen
95e313a283 file filter: Be save against NULL
g_content_type_from_mime_type may return NULL, deal with that.

https://bugzilla.gnome.org/show_bug.cgi?id=782180
2017-05-08 16:35:53 -04:00
Michael Catanzaro
cfd15c95b0 menubutton: Remove prelight state when button is deactivated
If the button is deactivated, it should not appear to be hovered
anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=781992
2017-05-08 16:03:33 +02:00
Christoph Reiter
004aba44df gtkdnd: restore drag window movement for the unmanaged case
5bb12474d9 removed the dnd window movement code to let
the gdk backends handle the window movement instead. While this
works for X11/wayland the win32 backend still uses the unmanaged
interface and expects the window movement to be handled on the gtk
side. This restores the functionality in case the dnd is unmanaged.

This fixes the drag window on Windows being stuck in the top left
corner instead of following the drag position.

https://bugzilla.gnome.org/show_bug.cgi?id=781737
2017-05-05 17:42:39 +02:00
Emmanuele Bassi
777906e26c meson: Silence the introspection scanner
We want the warnings, but not every single message.
2017-05-05 11:17:02 +01:00
Olof-Joachim Frahm
1681d4ad77 Move style change for popover creation.
Creating with `gtk_popover_new_from_model` should be exactly the same as
if via `gtk_popover_new` plus `gtk_popover_bind_model`.

Also remove the style if the model is unbound at any point.
2017-05-05 11:37:20 +02:00
Mohammed Sadiq
00cd92ea71 linkbutton: Fix memory leak
strings returned by gtk_widget_get_tooltip_text() and
gtk_widget_get_tooltip_markup() has to be freed when no longer
required.

https://bugzilla.gnome.org/show_bug.cgi?id=782202
2017-05-05 11:18:25 +02:00
Timm Bäder
3d21128dbb Remove gtk_widget_get_preferred_*
They are unnecessary now that we have gtk_widget_measure.
2017-05-05 11:18:25 +02:00
Timm Bäder
1a7a089e2c window: Stop using gtk_widget_get_preferred* 2017-05-05 11:18:24 +02:00
Timm Bäder
8b2c71703e widget: Remove useless assignment
We don't use adjusted_allocation after this line.
2017-05-05 11:18:05 +02:00
Timm Bäder
91932ffbc7 button: Remove baseline_align value
It's unused.
2017-05-05 11:18:05 +02:00
Matthias Clasen
7625e40e82 clipboard: Try the mimetype first
Try text/plain;charset=utf-8 first, before falling back to
X11-isms like UTF8_TEXT. This makes things work on Wayland
compositors that don't carry a heavy X11 legacy around.

https://bugzilla.gnome.org/show_bug.cgi?id=781814
2017-05-03 18:50:21 -04:00