Commit Graph

29640 Commits

Author SHA1 Message Date
Benjamin Otte
04ac4c66ae dnd: Pass device, not event
You don't start a dnd operation with a device, you start it with an
event.
2017-12-12 00:31:49 +01:00
Benjamin Otte
23c798b41d dnd: No longer allow passing -1
Nobody ever does that and special cases are evil.
2017-12-12 00:29:51 +01:00
Benjamin Otte
756b276070 dnd: Remove button argument from drag_begin()
It was unused.
2017-12-12 00:29:51 +01:00
Matthias Clasen
1e4aeb2efb calendar: Stop using a legacy event handler
Replace the motion_notify handler by a drag gesture.
2017-12-10 22:15:12 -05:00
Matthias Clasen
474d36499a Adwaita: Set an icon size for drag icons
This makes drag icons set from icon names come out
at a size that it large enough to not disappear under
the drag cursor.
2017-12-10 21:17:13 -05:00
Matthias Clasen
c2bdae23a1 Set a style class for drag icons
This lets us use the new icon-size machinery to
ensure we don't have tiny drag icons when using
named icons.
2017-12-10 21:16:31 -05:00
Benjamin Otte
643a6c2311 gdk: Remove gdk_drag_manage_dnd()
Instead, pass the actions as part of gdk_drag_begin() and insist DND is
always managed.

A new side effect is that gdk_drag_begin() can now return %NULL.
2017-12-11 01:46:33 +01:00
Benjamin Otte
7e0844d92f dnd: No point in determining the keyboard
We only use the pointer.
2017-12-11 01:02:31 +01:00
Benjamin Otte
218efa62ef dnd: Pass dx/dy instead of x_root/y_root
This way, we don't need root coordinates when computing the dnd start
position.
2017-12-11 01:02:31 +01:00
Benjamin Otte
a7c3c794df dnd: Make gdk_drag_context_set_device() private
There's no need to call it from GTK anymore, because we pass the device
to gdk_drag_begin().
2017-12-11 01:02:31 +01:00
Benjamin Otte
33a634be33 calendar: Don't request drag data on every motion event
At least wait until we've received the previous one.
2017-12-11 01:02:31 +01:00
Benjamin Otte
565d8325c4 gdk: Remove outdated gdk_drag_begin() alternatives
There's only one that's ever used, so delete the others and rename this
one to gdk_drag_begin().
2017-12-11 01:02:31 +01:00
Matthias Clasen
6af4947e70 link button: Set a drag icon
It is a bit odd to drag nothing around, so set an icon.
2017-12-10 14:05:01 -05:00
Matthias Clasen
642588b9cd docs: Don't mention css for setting cursors
We don't have a plan to make this work, so lets not
talk about it in the docs.
2017-12-09 23:59:31 -05:00
Matthias Clasen
c35cb0eb1b entry: Allocate the progress bar only what it needs
We were allocating the progress bar to the full size
of the entry. This made entry icons loose their cursors,
since they were 'covered' by the progress bar, even though
it doesn't draw anything there.
2017-12-09 23:48:35 -05:00
Colomban Wendling
69344322d1 Fix updating the widget accessible description when using its tooltip
We need to notify ATK the description changed when the tooltip text associated
with the widget changes and gtk_widget_accessible_get_description() would use
it as the description.

https://bugzilla.gnome.org/show_bug.cgi?id=779009
2017-12-09 21:24:44 -05:00
Benjamin Otte
7a17865b22 dnd: Remove "delete" argument from gtk_drag_finish()
The argument is ignored by anything but X11.
It's treated like suggested_action == MOVE.

So do that in gtk_drag_finish(), too.
2017-12-10 01:33:38 +01:00
Benjamin Otte
803cbd576f dnd: Introduce gdk_drop_read_async() and use it
This is the replacement for selection usage.

Backend implementations for X11 (missing support for backwards compat
formats like COMPOUND_TEXT) and Wayland are included.

GTK code should be adapted to use gdk_drop_read_*() functions instead
of gtk_drag_get_data().
2017-12-10 01:09:14 +01:00
Benjamin Otte
234d34366a clipboard: Add the useful stuff from reverted commit
This is the parts of dc50e0637f that
should have been committed but were reverted in
b5c62cf86f to unbreak the build.
2017-12-10 01:09:14 +01:00
Carlos Garnacho
8233cf3688 gtkwindow: Allow edge resizing from corners if constraints forbid either side
The fix is twofold. First, when checking that a corner is resizable, we must
check the constraints on both edges. Second, when checking either edge we
must include both perpendicular sides in order to allow those to be
resizable when the constraint does not allow resizing the edge being
checked.
2017-12-09 22:19:57 +01:00
Carlos Garnacho
6b4dd4be6c gtkwindow: Use shadow border when calculating resize areas positions
This way resize areas are correctly positioned right outside the visible
window edge on all sides.
2017-12-09 17:33:44 +01:00
Carlos Garnacho
f6ef18ac74 gtkwindow: Do not account handle size when checking content area
This is necessary to bring back the L-shaped resize corners. On all edges
(not corners) the handle width is determined by the border size.
2017-12-09 17:32:02 +01:00
Rico Tzschichholz
d872640927 Fix some parameter name mismatches to make g-ir-scanner happier 2017-12-09 15:36:35 +01:00
Matthias Clasen
b3ebffa07d Switch the order for cursor lookup
When looking for the cursor to apply, start from the innermost
widget and go up. This is the right behavior for cases like
entry icons. The top-down order we were using so far is the
right behavior for cases like global wait cursors. Since we
have entry icons in gtk, but not global wait cursors, lets
pick the other order for now.
2017-12-09 08:35:23 -05:00
Timm Bäder
da0582075a treeview: Don't draw background twice
This is done unconditionally for all widgets these days.
2017-12-09 13:15:07 +01:00
Timm Bäder
f7f0461471 recorder: Show rounded clip node corner size info 2017-12-09 13:14:59 +01:00
Timm Bäder
329683f746 snapshot: Don't create blur nodes with radius 0 2017-12-09 13:14:51 +01:00
Timm Bäder
f6f1dfb55d snapshot: Collapse color matrix nodes
Color matrix nodes as the child of other color matrix nodes can happen
quite frequently as a result of CSS. To ease the renderer
implementations, collapse chains of color matrix nodes into one.
2017-12-09 13:14:44 +01:00
Matthias Clasen
e7ed7c1913 paned: Grab during the drag
This is necessary to ensure we get the right cursor.
2017-12-08 21:09:24 -05:00
Marco Trevisan (Treviño)
29f36fed08 cssshadowvalue: don't apply the y_scale offset twice to the shadow
As per commit 942e904 this changed causing a regression that
seems to be visible only when scale > 2.

https://bugzilla.gnome.org/show_bug.cgi?id=791363
2017-12-08 18:23:10 -05:00
Matthias Clasen
072f06abf7 Fix fallout from g_object_ref change
g_object_ref now returns the type of the object that was
passed. Introduce cast as necessary to avoid warnings due
to this.
2017-12-08 17:48:47 -05:00
Matthias Clasen
029a84aa74 Fix fallout from the show-close-button rename
I had overlooked ui files. We should really
validate those during build.
2017-12-08 11:29:14 -05:00
Matthias Clasen
fec0dc2b13 Rename GtkHeaderBar::show-close-button
It is about all window buttons, so rename it to ::show-title-buttons.

https://bugzilla.gnome.org/show_bug.cgi?id=779862
2017-12-07 22:37:06 -05:00
Colin Leroy
0156c52a2c placesview: Present FUSE-reachable network shares in Other Locations
The documentation about gtk_file_chooser_set_local_only() states
that "non-native files may still be available using the native
filesystem via a userspace filesystem (FUSE)."
The code that made this possible in GTK+2 was missing from GTK+3 and
that represented a regression for Linux users in numerous applications
(Firefox, Thunderbird, Chromium, ...)

https://bugzilla.gnome.org/show_bug.cgi?id=787128
2017-12-07 21:31:46 -05:00
Matthias Clasen
2d85e8df8b Fix a typo in the docs 2017-12-06 23:39:27 -05:00
Timm Bäder
49e624bbe9 paned: Restrict picking to allocation
Same reason as GtkViewport does it: We might allocate child widgets
outside of the paned's content allocation. For drawing, we add a clip
node.

This was causing the "Record" button in the inspector recorder to ignore
pointer events since the treeview column header label in the GtkPaned
was swallowing it.
2017-12-06 08:23:03 +01:00
Timm Bäder
1aa811ce12 Remove all gtk_widget_get_content_size usages
And remove the function itself. Make everything use gtk_widget_get_width
and gtk_widget_get_height instead.
2017-12-06 07:56:12 +01:00
Christian Hergert
dc8320c129 autocleanups: allow g_autoptr() usage with GtkTreePath
As the summary says, this allows using g_autoptr(GtkTreePath). This is
useful for API that uses out parameters for GtkTreePath that need to be
freed.

https://bugzilla.gnome.org/show_bug.cgi?id=791234
2017-12-05 12:33:50 +00:00
Matthias Clasen
b5c62cf86f Revert "clipboard: Add gdk_clipboard_set()"
This reverts commit dc50e0637f.

This broke the build.
2017-12-04 23:09:54 -08:00
Benjamin Otte
dc50e0637f clipboard: Add gdk_clipboard_set()
This API allows specifying a GType and va_args of a value of that type
to set the clipboard contents. This massively simplifies setting weird
object types into the clipboard.
2 example patches included in this patch are the GtkTextBuffer and the
file list in the file chooser.

Using gobject-introspection, this should work without specifying the
type, so that you can literlally say
  clipboard.set ("Hello World")
or
  clipboard.set (pixbuf)
which is why I've also marked all other setters as (skip). They just
exist in C as wrappers for type safety reasons.
2017-12-05 05:29:03 +01:00
Benjamin Otte
4658d7ea54 dnd: Remove x/y coordinates from drag-data-received
This is in preparation of using input streams to show that these
coordinates aren't needed most of the time and can otherwise be saved
during GtkWidget::drag-drop.
2017-12-05 05:29:00 +01:00
Timm Bäder
8619ff0744 switch: Remove unused variable 2017-12-04 18:35:48 +01:00
Matthias Clasen
841eb45b66 actionbar: Add more docs for gtk_action_bar_get_revealed
This stops gtk-doc complaints.
2017-12-04 07:42:01 -08:00
Matthias Clasen
b912416be5 about dialog: Add some missing docs
gtk_about_dialog_set/get_system_information are new,
and were missing docs.
2017-12-04 07:42:01 -08:00
Timm Bäder
93df23d962 Remove some more gtk_widget_get_content_size uses 2017-12-04 12:42:52 +01:00
Timm Bäder
3a3783dfcd image: Stop using gtk_widget_get_content_size 2017-12-04 12:24:18 +01:00
Timm Bäder
dbc4796d6a popover: Stop using gtk_widget_get_content_size 2017-12-03 22:05:15 +01:00
Timm Bäder
7cc9bee7a2 spinner: Stop using gtk_widget_get_content_size 2017-12-03 22:04:59 +01:00
Benjamin Otte
acee3809b3 dnd: Remove unused variables 2017-12-03 06:50:51 +01:00
Matthias Clasen
e74c46fc4e dnd: Handle rootwin drop in gdk
This lets us drop the only use of the drag protocol in gtk.
2017-12-03 06:22:25 +01:00