Commit Graph

60995 Commits

Author SHA1 Message Date
Benjamin Otte
7ca149ff90 Remove gdk_content_provider_new_with_formats()
See the removal of gdk_content_provider_new_with_callback() for a
rationale.
2020-02-18 02:40:00 +01:00
Benjamin Otte
7ae5fd357c tests: Modernize testdnd2 2020-02-18 02:40:00 +01:00
Benjamin Otte
b8cf7ea1c6 dnd: Port the TreeModel machinery to GValue DND 2020-02-18 02:40:00 +01:00
Benjamin Otte
1145da3ea5 placessidebar: Modernize DND
No more shooting pointers through pipes
2020-02-17 21:56:16 +01:00
Benjamin Otte
27d7aa1407 notebook: Use proper DND
Actually use GValues for the DND operation instead of sending GBytes of
pointer addresses through pipes.

This is a bit complicated because we need to special-case rootwindow
drops, because they're handled on the source side, so we need a custom
ContentProvider.
2020-02-17 21:56:16 +01:00
Benjamin Otte
9703fcc605 notebook: Move dnd scrolling via arrows to own drop target
This removes excess code from the tab dnd machinery
2020-02-17 21:56:16 +01:00
Benjamin Otte
e25bfa6a61 dragdest: Handle NULL content formats everywhere
NULL means we don't do content formats checks and accept everything.

We use this for notebook arrows or expanders that react to ongoing
drags.
2020-02-17 21:56:16 +01:00
Benjamin Otte
9a7607b419 contentprovider: Add a union content provider 2020-02-17 21:56:16 +01:00
Benjamin Otte
f5e3584b5b placessidebar: Don't claim to support text dnd
Because you don't. And never did.
2020-02-17 04:04:21 +01:00
Benjamin Otte
80ba7fd682 dragdest: Make gtk_drop_target_new() args be transfer full
Saves tons of code.
2020-02-17 04:04:21 +01:00
Benjamin Otte
91d91a29e8 colorbutton, colorswatch: Simplify DND
- Use GDK_TYPE_RGBA and let GDK do the conversion from
  application-x-color
- Don't do extra mime type checks when accept() does that for us already
2020-02-17 04:04:21 +01:00
Benjamin Otte
3a7e3cf90d dragdest: Simplify function
Make it obvious that the functions checks one condition and then the
other.
2020-02-17 04:04:21 +01:00
Benjamin Otte
e1f8c1430f dnd: simplify code
The old code did mimetype checks everywhere when type compatibility has
since been moved to the GtkDropTarget::accept signal.

So the code can now just assume a compatible mime type exists.
2020-02-17 04:04:21 +01:00
Benjamin Otte
da83457a60 dnd: Remove gdk_content_provider_new_with_callback()
Content providers are meant to be immutable, apart from very special
cases, but in those cases they need to emit
gdk_content_provider_content_changed().

Having a constructor that just uses a get_func invites abuse of this
by not making developers aware of those requirments.
In fact, all users in GTK failed to do this.

Instead, code should use the GtkDragSource::prepare signal to create
content providers when needed.

The same problem exists with gdk_content_provider_new_with_formats(),
but this commit doesn't touch that.
2020-02-16 20:10:31 +01:00
Benjamin Otte
dbad440468 testdnd3: Use GValue dnd 2020-02-16 20:10:30 +01:00
Benjamin Otte
8d2ed36a1b contentprovider: Add gdk_content_provider_new_typed()
Gets around the boilerplate required to create and initialize a GValue
by having this function doing it via G_VALUE_COLLECT().
2020-02-16 20:10:30 +01:00
Benjamin Otte
762c4602fb wayland: Destroy the offer on gdk_drop_finish()
Otherwise the compositor won't be aware the dnd failed and will in turn
not notify the drag source.
2020-02-16 20:10:30 +01:00
Benjamin Otte
5a726bc665 drop: Add a state machine for tracking events 2020-02-16 20:10:30 +01:00
Benjamin Otte
410dbdf671 widget: Fix namespacing problem
In Vala and JS at least, gtk_widget_get_css_name() and
gtk_widget_class_get_css_name() are resolved to
GtkWidget.get_css_name().

To avoid this problem, we rename the class version.
2020-02-16 20:05:05 +01:00
Benjamin Otte
43b8aff62c widget: Fix typos for css-clases property 2020-02-16 19:57:45 +01:00
Benjamin Otte
47c8026e38 Merge branch 'wip/otte/dnd' into 'master'
some DND fixes

See merge request GNOME/gtk!1440
2020-02-15 23:45:25 +00:00
Benjamin Otte
b844f34cda tests: Do proper local DND
Just transfer GValues.
2020-02-15 22:33:57 +01:00
Benjamin Otte
46bbb397e1 wayland: Use a magic mime type for local DND
Otherwise the compositor gets all confused when it's trying to make
drag happen but we know it's not going to happen.

After all, we exchange data behind its back, we just need to keep it
informed.
2020-02-15 22:33:57 +01:00
Benjamin Otte
894ac6c126 dragdest: Use format matching APIs 2020-02-15 21:04:33 +01:00
Benjamin Otte
a824da66d9 drop: Ensure all relevant formats are available
1. GdkDrop does deserialization, so add the deserialize formats

2. If the drop is local, we can copy straight from the drag, so we can
   also copy all its formats. This fixes cases where the backend would
   drop formats it doesn't support.
2020-02-15 20:02:44 +01:00
Timm Bäder
08501c9510 calendar: Emit {next,prev}-{month,year} signals
Fixes #833
2020-02-15 17:18:27 +01:00
Timm Bäder
a4ecfd8f33 widget: Use get_css_name() in get_property()
Instead of reimplementing it there.
2020-02-15 17:18:27 +01:00
Timm Bäder
28482e52be Adwaita: Add focus outlines back to scale troughs
Fixes #189
2020-02-15 17:18:27 +01:00
Timm Bäder
bf839dbb88 coloreditor: Scale h value to 360
Fixes #1321
2020-02-15 17:18:27 +01:00
Timm Bäder
2529464e21 range: Avoid rounding errors when allocating highlight
Fixes #2438
2020-02-15 17:18:26 +01:00
Timm Bäder
7e43034068 widget: Add css-classes property
Mirroring the values added and removed via {add,remove}_css_class().
2020-02-15 17:18:26 +01:00
Timm Bäder
52979a0e93 infobar: Remove _get_{action,content}_area()
Accessors like these are weird to have and we can add widgets to the
content area via gtk_container_add() as well as add widgets to the
action area via gtk_info_bar_add_action_widget().
2020-02-15 17:18:26 +01:00
Timm Bäder
78a5bf8e21 Remove gtk_info_bar_get_content_area() uses
We can just add() to the info bar directly.
2020-02-15 17:18:26 +01:00
Timm Bäder
8612a8a39f testinfobar: Stop using gtk_info_bar_get_content_area()
We have an easier way of adding widgets to the content area of an
infobar: Just gtk_container_add() them like usual.
2020-02-15 17:18:26 +01:00
Timm Bäder
a7de8e6b2f infobar: Don't store close button visibility separately
We can already set and query that value via
gtk_widget_{get,set}_visible() on the close button.
2020-02-15 17:18:26 +01:00
Timm Bäder
3cc57c2e3a actionbar: Use a bin layout 2020-02-15 17:18:26 +01:00
Timm Bäder
a1d47ec59f calendar: Add style class to today's label
Add the .today style class to the label indicating the current day.

Fixes #230
2020-02-15 17:18:26 +01:00
Timm Bäder
43a9f9bd02 calendar: Document style classes
Fixes #790
2020-02-15 17:18:26 +01:00
Matthias Clasen
e5d83eea30 events: Make proximity and scroll events have tools
The Wayland backend tries to set device tools on these
events, and it was just an oversight that they don't
carry them.
2020-02-15 09:44:34 -05:00
Benjamin Otte
5f7054862b Merge branch 'wip/otte/for-master' into 'master'
Drop GTK_WINDOW_POPUP

See merge request GNOME/gtk!1437
2020-02-14 20:42:11 +00:00
Matthias Clasen
8ef7013165 Drop gdk_surface_new_temp
GTK is not using this API anymore, and we want
to consolidate our surface types to just toplevels
and popups.
2020-02-14 21:20:12 +01:00
Matthias Clasen
723b894c19 testsuite: Stop using gdk_surface_new_temp
We can just use regular toplevels here.
2020-02-14 21:19:29 +01:00
Benjamin Otte
c1f71ee3e8 window: Remove GtkWindowType and window->type
And remove code that was making decisions on the type and just use
the part for toplevels.
2020-02-14 21:18:49 +01:00
Benjamin Otte
222e6e5d6e testsuite: Use GtkTextDirection instead of GtkWindowType
GtkWindowType is aout to be dropped, so use another enum for the enum
tests - one that is likely to survive for a long time.
2020-02-14 21:18:49 +01:00
Benjamin Otte
de49e47690 textview: Fix docs typo 2020-02-14 21:18:49 +01:00
Benjamin Otte
a278edab22 window: Remove type argument from gtk_window_new() 2020-02-14 21:18:49 +01:00
Benjamin Otte
c2bd4bc3cb testsuite: Replace popups with toplevels
The tests do not depend on the window being a popup.
2020-02-14 21:18:49 +01:00
Benjamin Otte
fb856d96cd builder: Use different construct-only property
The window type is going away, so use the css name instead.
2020-02-14 21:18:49 +01:00
Benjamin Otte
264967b764 widget: Add gtk_widget_get_css_name() API 2020-02-14 21:18:49 +01:00
Benjamin Otte
ad23ce23ad testsuite: Remove popup property from simplify tools
I'm not even sure a popup GtkAssistant should be a thing...
2020-02-14 21:18:49 +01:00