Commit Graph

55069 Commits

Author SHA1 Message Date
Benjamin Otte
637d5d633c gdk: Remove leftover type from autocleanup 2018-06-10 03:17:12 +02:00
Benjamin Otte
31e850cd7f wayland: Get rid of GdkWaylandSelection
Move data source handling into the DND code instead.
2018-06-10 03:17:12 +02:00
Benjamin Otte
cde1ee8662 wayland: Split drop context into GdkWaylandDrop
GdkWaylandDrop no longer inherits from GdkDragContext now.
2018-06-10 03:17:12 +02:00
Benjamin Otte
3c4d1356a0 wayland: Remove a bunch of unused functions 2018-06-10 03:17:11 +02:00
Benjamin Otte
1413ce13cb events: Make GdkEventDND have a GdkDrop member
... instead of a GdkDragContext.
2018-06-10 03:17:11 +02:00
Benjamin Otte
70ef32bb29 x11: Refactor DND filter
The filters now return TRUE/FALSE and no longer a GdkFilterReturn. They
also don't conform to the GdkFilterFunc typedef anymore but instead take
the arguments that they need.
2018-06-10 03:17:11 +02:00
Benjamin Otte
af70ca4ca2 x11: Use new DND event emitters 2018-06-10 03:17:11 +02:00
Benjamin Otte
de3a0dbcfd win32: Use new DND event emitters 2018-06-10 03:17:11 +02:00
Benjamin Otte
7ff9738561 wayland: Use new DND event emitters 2018-06-10 03:17:11 +02:00
Benjamin Otte
9870688e27 drop: Add private API for event emission 2018-06-10 03:17:11 +02:00
Benjamin Otte
41cc232c55 drop: Add GdkDrop:surface property
This replaces gdk_drag_context_get_dest_surface().
2018-06-10 03:17:11 +02:00
Benjamin Otte
7f715168c9 display: Don't wake up the main loop anymore
This is not needed because GTK must be run in the main thread these days,
which is the same one that runs the main loop. So when this function is
called, the main loop is awake.

https://bugzilla.gnome.org/show_bug.cgi?id=550989
2018-06-10 03:17:11 +02:00
Benjamin Otte
0d78bc7500 x11: Don't sneakily allocate memory in initializers 2018-06-10 03:17:11 +02:00
Benjamin Otte
83af276f35 dnd: Add gdk_event_get_drop()
And remove gdk_event_get_drag_context().

All GTK code now only uses GdkDrop for dropping.
2018-06-10 03:17:11 +02:00
Benjamin Otte
0964f2b2c0 wayland: Fix drop operations for new semantics 2018-06-10 03:17:11 +02:00
Benjamin Otte
e2891cd506 dnd: Remove GdkDragContext::commit_drag_status() vfunc
The idea behind the vfunc doesn't work as status updates can happen
asynchronously.

A better solution needs to be found.
2018-06-10 03:17:11 +02:00
Benjamin Otte
f40f33afb9 dnd: Make drag-motion and drag-drop signals use GdkDrop 2018-06-10 03:17:11 +02:00
Benjamin Otte
2a85948942 dnd: Make drag-data-received use a GdkDrop 2018-06-10 03:16:51 +02:00
Benjamin Otte
d4b8579488 drop: Add gdk_drop_get_drag()
For now, it'll always return NULL. We'll fix that later.
2018-06-10 03:16:51 +02:00
Benjamin Otte
b5d89153b5 widget: Make GtkWidgetClass::drag_leave() take a GdkDrop
Drag Contexts are on their way out!
2018-06-10 03:16:51 +02:00
Benjamin Otte
390012a633 dnd: Add gdk_drop_finish()
and move the vfunc into GdkDrop.
2018-06-10 03:16:51 +02:00
Benjamin Otte
60d83804d7 dnd: Get rid of gtk_drag_finish()
It's just a wrapper around gdk_drag_finish(), so use that one instead.
2018-06-10 03:16:51 +02:00
Benjamin Otte
ed8423e15c dnd: Rename gdk_drop_finish() => gdk_drag_finish()
This is a simple rename, so that we can reintroduce gdk_drop_finish()
with the GdkDrop object.
2018-06-10 03:16:51 +02:00
Benjamin Otte
63571fc5e5 dnd: Move the gdk_drag_status() function
It's now gdk_drop_status().

Also clarify the intended semantics.
2018-06-10 03:16:51 +02:00
Benjamin Otte
b36c5e48e3 dnd: Add gdk_drop_get_actions()
This uses the new method without GDK_ACTION_ASK:

Either it is a single action (queryable via gdk_drag_action_is_unique())
or it is not and then the drop target has to make a decision
(potentially by asking someone).
2018-06-10 03:16:51 +02:00
Benjamin Otte
2d6e88e3ee dnd: Make actions a private member variable
Use a setter in the backends.
2018-06-10 03:16:51 +02:00
Benjamin Otte
0c1f739c1a x11: Remove unused variables 2018-06-10 03:16:51 +02:00
Benjamin Otte
8aadfd730e wayland: Set correct variable
This got messed up in commit 7f8a8f221d.
2018-06-10 03:16:51 +02:00
Benjamin Otte
7b2e2d6bad dnd: Add gdk_drag_action_is_unique()
This will be necessary once we remove the ASK action.
2018-06-10 03:16:51 +02:00
Benjamin Otte
34c2e1b3fb dnd: Remove GDK_ACTION_DEFAULT and GDK_ACTION_PRIVATE
They're unused and nobody knows what they're supposed to men anyway.
2018-06-10 03:16:51 +02:00
Benjamin Otte
7be144b436 drop: Move gdk_drop_read_async() to GdkDrop class 2018-06-10 03:16:51 +02:00
Benjamin Otte
0ee542e588 dnd: Add GdkDrop base class for GdkDragContext
The ultimate goal of this patch series is to split GdkDragContext into
GdkDrop + GdkDrag classes for the destination and source side of a dnd
operation.

The refactoring is meant to work something like this:
1. Introduce GdkDrop as a base class
2. Make all drop related code (like GdkEvent) use GdkDrop instead of
   GdkDragContext. Move/duplicate APIs to allow that.
3. Port all drop contexts in the backends from GdkDragContext to GdkDrop
4. Delete all APIs in GdkDragContext that aren't needed anymore.
5. Make GdkDragContext no longer a GdkDrop subclass
6. Rename GdkDragContext to GdkDrag
2018-06-10 03:16:51 +02:00
Benjamin Otte
a34a5df674 picture: Don't use g_str_equal() with potential NULLs 2018-06-10 02:56:18 +02:00
Benjamin Otte
299e2ed44c docs: Add GtkEventControllerKey to index 2018-06-10 02:35:30 +02:00
Benjamin Otte
4c961349ab dnd: Ref the GdkDrop during the DND operation
It might go away if the DND takes too long otherwise...
2018-06-10 02:35:30 +02:00
Benjamin Otte
b7ecfbce21 quartz: Remove gtkdnd-quartz.c
It shows up in my git diff calls and is completely broken.
2018-06-10 02:33:53 +02:00
Benjamin Otte
40321d331f x11: Remove useless check
The check survived from GTK2 when that function could still return
GdkPixmap and GdkFont objects and was accompanied by this comment:

  /* We may receive events such as NoExpose/GraphicsExpose
   * and ShmCompletion for pixmaps
   */
2018-06-10 02:33:53 +02:00
Benjamin Otte
ce6227840d clipboard: Remove return statements from void function 2018-06-10 02:31:10 +02:00
Benjamin Otte
896f72d33b gtk-demo: Use GtkImages to select the puzzle 2018-06-10 02:25:55 +02:00
Benjamin Otte
884aaa2193 iconhelper: Always size contents to icon size
No more special casing for paintables. If you want the special case for
paintables, you should use GtkPicture.
2018-06-10 02:25:28 +02:00
Benjamin Otte
f58c556adb image: Remove gtk_image_set_keep_aspect_ratio()
and gtk_image_set_can_shrink().

Images are meant to always be icon-sized, they can never shrink below
that.

And images are icons, so they are meant to be square. If they are
not, we pretned that's by accident and keep aspect ratio.
2018-06-10 02:25:28 +02:00
Benjamin Otte
7690c2d042 gtk-demo: Make sliding puzzle demo use GtkPicture 2018-06-10 02:25:28 +02:00
Benjamin Otte
cbd47fa770 gtk-demo: Port images demo to use a GtkPicture in places 2018-06-10 02:23:02 +02:00
Benjamin Otte
45d78f360f video: Use a Picture instead of an Image 2018-06-10 02:23:02 +02:00
Benjamin Otte
6546ef3459 picture: Introduce
This commit introduces GtkPicture, which is supposed to complement
GtkImage.

GtkImage will be adapted to always display an icon, while
GtkPicture displays regular imagery.
2018-06-10 02:23:02 +02:00
Matthias Clasen
9d48a95d9a puzzle: fix some compiler warnings
These slipped under the radar, sorry.
2018-06-09 19:39:43 -04:00
Timm Bäder
cfbba2c710 widget: Use priv pointer less
Instead declare a priv local. We should do this even if we don't remove
the priv pointer from GtkWidget entirely, just to stay consistent with
new code we introduce.
2018-06-09 21:25:15 +02:00
Fran Dieguez
085368eb93 Update Galician translation 2018-06-08 08:09:57 +00:00
Matthias Clasen
1ee23d0d49 puzzle: Add mouse support
Make it so that clicking on a puzzle piece moves enough
pieces to move the empty space there, if it is possible.
2018-06-07 21:47:30 -04:00
Matthias Clasen
ebf042d305 puzzle: Use plain labels
The previous code looked cool in the UI, but was too much
of a hack in the code.
2018-06-07 21:47:30 -04:00