Commit Graph

267 Commits

Author SHA1 Message Date
Jasper St. Pierre
030b62d122 gtkdnd: Introduce a new API for more accurate drag origin data
When trying to drag, we currently the position of the first motion
event to determine where the drag came from. This might be alright
in the case of the old animation, but the data will be inaccurate
if the user has moved the pointer quite a bit since pressing the
cursor to start dragging. While we could monkey patch the GdkEvent
at the widget layer, this is unintuitive and strange.

Add a new API that takes a set of pointer coordinates describing
the origin of the drag. Additionally, adapt most widgets to use
it and use it with correct coordinates.

https://bugzilla.gnome.org/show_bug.cgi?id=705605
2013-08-14 07:12:52 -04:00
Jasper St. Pierre
e80d1f0523 gtkdnd: Use a more modern spring back animation for cancelled drags
https://bugzilla.gnome.org/show_bug.cgi?id=705605
2013-08-14 07:12:52 -04:00
Christian Hergert
a0bc600140 dnd: Motif DnD is no longer supported, update docs. 2013-08-08 16:06:00 +02:00
Jasper St. Pierre
b9d85b9412 gtkdnd: Clean up the doc comment of gtk_drag_begin 2013-08-07 11:53:04 -04:00
Alexander Larsson
8e423ba292 gtkdnd: Use surface based cursor APIs
This allows things to correctly scale things on HiDPI screens.
2013-08-07 13:34:10 +02:00
Alexander Larsson
0296f1a43a gtkdnd: Use RGBA windows when dragging if possible
If we have rgba visuals and a composited screen we should
just use a RGBA window rather than shaped windows.
2013-08-05 16:49:18 +02:00
Matthias Clasen
2f1fa7cdc3 Drop some unnecessary includes
Drop includes of deprecated headers where they are
no longer needed.
2013-07-19 22:32:23 -04:00
Matthias Clasen
0aa57d26b5 Move wholly deprecated classes to gtk/deprecated/
We've recently a number of classes wholly. For these cases,
move the headers and sources to gtk/deprecated/ and adjust
Makefiles and includes accordingly.

Affected classes:
GtkAction
GtkActionGroup
GtkActivatable
GtkIconFactory
GtkImageMenuItem
GtkRadioAction
GtkRecentAction
GtkStock
GtkToggleAction
GtkUIManager
2013-07-19 21:39:47 -04:00
William Jon McCann
424e1d0059 Start deprecating some GtkStock API 2013-06-25 19:05:32 -04:00
William Jon McCann
02c793f24a Start migrating internals away from GtkStock 2013-06-24 22:20:49 -04:00
ammonkey
4445dce697 fix mem leak in gtk_drag_set_icon_surface, destroy pattern
https://bugzilla.gnome.org/show_bug.cgi?id=681446
2013-04-13 20:06:43 -04:00
Matthias Clasen
329f7af159 Fix DND
The removal of the Motif DND code accidentally changed the
value of the TARGET_DELETE enumeration value, breaking DND
pretty badly.
2013-03-21 00:00:19 -04:00
Matthias Clasen
0cc688aa92 Drop the Motif DND protocol
The implementation is not working and unused, since XDND is the
de-facto standard under X nowadays.

https://bugzilla.gnome.org/show_bug.cgi?id=695476
2013-03-12 20:03:19 -04:00
Matthias Clasen
02e9152738 Fix DND with frame sync
Mutter magically ignores override-redirect windows with geometry
-100-100+1+1, and this breaks the frame synchronization between
gtk+ and mutter. For now, we avoid the issue by simply giving
the window a different geometry.
https://bugzilla.gnome.org/show_bug.cgi?id=694217
2013-02-28 07:48:06 -05:00
Matthias Clasen
2661403f88 Fix DND keyboard control with XI2
We are using XI2 to grab the key events, but we did not do the
necessary extra work to make GDK deliver root window events to us.

https://bugzilla.gnome.org/show_bug.cgi?id=681006
2012-08-06 22:56:59 -04:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Carlos Garcia Campos
6e9b06028c gtkdnd: Use symbolic names for button numbers 2012-01-27 09:47:43 +01:00
Alexander Larsson
6afeb8d355 Move fallback dnd cursors to resources 2012-01-16 14:19:19 +01:00
Javier Jardón
d005b01319 gtk/*: Use g_list_free_full() convenience function 2012-01-05 04:22:43 +01:00
Cosimo Cecchi
adbfbb7278 dnd: port to GtkIconHelper 2011-11-30 16:39:59 -05:00
Bastien Nocera
0888e6f485 gtk: Fix XIGrabKeycode usage
A modifier of "0" is still a modifier and must be submitted normally.
A num_modifiers of 0 is essentially a noop in the server.

As mentioned by Peter Hutterer <peter.hutterer@who-t.net>

https://bugzilla.gnome.org/show_bug.cgi?id=662839
2011-10-28 12:03:22 +01:00
Matthias Clasen
633918158b DND: Work better with XI2
It turns out that simply using XIGrabKeycode instead of XGrabKey
makes the DND keyboard support mostly work (there seem to be some
minor issues with modifiers). This means we no longer grab the
keyboard actively during DND, which in turn makes Alt-Tab and
other window manager shortcuts work again during DND.

At the same time, bring the DND key handling code into the
multi-backend work, by checking for X11 and XI2 at runtime,
in addition to compile time.
2011-10-20 20:59:50 -04:00
John (J5) Palmieri
9c4892f291 [gi] add more annotations to force drag and drop api to be methods 2011-06-29 14:54:25 -04:00
John (J5) Palmieri
f46f038abd [gi] make sure gtk_drag_dest_unset is annotated as a method 2011-06-29 12:11:36 -04:00
Daniel Drake
794a3706cd gtkdnd: Don't bind/unbind keycodes that couldn't be determined
At http://dev.laptop.org/ticket/10643 we are seeing that drag-and-drop
within the Sugar shell causes all of Sugar's custom keybindings to be
removed.

This is because gtkdnd tries to unbind XK_KP_Space, which (on my systems)
is resolved to NoSymbol by XKeycodeToKeysym(). NoSymbol has value 0,
the same as AnyKey, and XUngrabKey(AnyKey) is equivalent to unbinding
all possible keycodes.

Fix this by catching NoSymbol before binding/unbinding.

https://bugzilla.gnome.org/show_bug.cgi?id=652402
2011-06-12 21:44:00 -04:00
Colin Walters
b90e8cfc36 gtkdnd: Add API that takes GIcon
This will be useful for me to port gnome-panel to gnome-menus 4, which
uses GAppInfo, which in turn returns icon references as GIcon.

https://bugzilla.gnome.org/show_bug.cgi?id=649295
2011-05-03 12:53:46 -04:00
Javier Jardón
f7b7e8a6b8 Move documentation to inline comments: GtkDnd 2011-04-18 02:08:37 +01:00
Benjamin Otte
8a16876fc7 dnd: Use G_N_ELEMENTS()
Now that we have wesome macros in glib 2.0, we can use them. Woohoo, GTK
2.0 will be so awesome in the future.
(Did anybody touch dnd code this millenium?)
2011-03-26 23:48:42 +01:00
Benjamin Otte
ac6c6b03d9 gtk: Fix warnings for dnd code without XInput 2011-02-11 23:53:48 +01:00
Michael Natterer
1865011b7f gtk: don't send BUTTON_RELEASE to unrealized widgets
which happened when the source widget was hidden or destroyed while a
drag was going on, like when dragging from a popup that got a grab
broken as result of the dnd operation.
2011-02-11 10:48:43 +01:00
Johan Dahlin
358a2b8675 Rename time to time_ to avoid a scanner warning 2011-02-08 13:29:57 -02:00
Benjamin Otte
1483145806 API: image: Move private struct definitions into private header
They weren't privatized because the dnd code used them, too. But a
private header can allow the dnd code to be nasty, so go dnd code!
2011-02-08 08:58:49 +01:00
Laszlo Pandy
295c2fe8d1 [GI] Add method annotations to remaining gtk_drag_* functions.
https://bugzilla.gnome.org/show_bug.cgi?id=639945
2011-02-03 15:10:43 +01:00
Martin Pitt
1bd36ce723 [GI] Annotate gtk_drag_{dest,source}* as methods
As these do not start with gtk_widget_*, the GI scanner does not recognize them
as methods. With the recently added (method) annotation [1] it is now possible
to mark them as proper methods of GtkWidget.

https://bugzilla.gnome.org/show_bug.cgi?id=639945

[1] http://git.gnome.org/browse/gobject-introspection/commit/?id=09bca85dd4
2011-02-02 17:51:48 +01:00
Pavel Holejsovsky
2f0d40335b [GI] Add missing (transfer) annotations 2011-01-20 13:57:18 +01:00
Carlos Garnacho
96d8f85dcc Make DnD code use GtkStyleContext for the highlight rectangle. 2011-01-04 03:06:20 +01:00
Benjamin Otte
0c285341a9 API: gdk: gdk_display_get_device_state() => gdk_device_get_position()
The API was not display-specific, but belonged to the device. Also, we
didn't find a user of the modifier mask, so we dropped it.
2010-12-27 18:46:41 +01:00
Matthias Clasen
d77dcfb9b2 Better fix for keynav dnd
With proper rounding, we can go back to a 'small step' of 1.
2010-12-22 22:33:40 -05:00
Matthias Clasen
7e0a30b752 Abort a drag when a keynav drop has not destination
This was claimed to cause problems for Chromium, see bug 599130.

Also work around apparent rounding errors in XIWarpDevice by
setting the 'small step' for keynav dnd to 2 instead of 1 - I notice
that a warp seems to sometimes warp a little less than I tell it to,
and if I tell it to only move by 1 pixel then moving less means
that you are stuck.
2010-12-22 21:47:14 -05:00
Benjamin Otte
66f7c3a562 API: gdk: gdk_display_warp_device() => gdk_device_warp()
warping devices has nothing to do with displays, so putting it there
seems weird.
2010-12-21 12:07:06 -05:00
Benjamin Otte
8f1f743903 gtk: Use g_object_unref instead of gdk_cursor_unref 2010-12-21 12:07:05 -05:00
Matthias Clasen
07d49ee56a Merge libgdk and libgtk
This commit does a number of things:
- remove some dead wchar configury from configure.ac and gdkconfig.h
- repurpose gdkconfig.h as header that contains GDK_WINDOWING_foo
  macros for each included backend, include it in gdk.h and install
  it in $includedir instead of below $libdir
- drop the backend from the library names
- build libgdk-3.0.la as a convenience lib and include it in libgtk-3.0.la
It does not yet enable building multiple backends at the same time.
2010-12-21 12:06:55 -05:00
Javier Jardón
26a304c54b Move GtkSelectionData to a private header 2010-12-19 20:48:20 +00:00
Javier Jardón
a86d1fa7c3 gtk/gtkdnd.c: Use accessor functions to access GtkSelectionData 2010-12-15 23:58:16 +00:00
Matthias Clasen
83204928b9 Don't access GdkDragContext fields directly
Instead use the accessors.
2010-12-10 00:59:07 -05:00
Carlos Garcia Campos
8017092977 dnd: Use gtk_widget_render_icon_pixbuf()
Instead of gtk_widget_render_icon() which is now deprecated.
2010-12-08 17:10:34 +01:00
Michael Natterer
fb5dd9f72f Move all GdkDevice members to private and add one missing accessor 2010-11-23 20:25:13 +01:00
Matthias Clasen
f5207ab647 Don't g_free gslice-allocated structures
This was causing memory corruption when removing remote plugs from
sockets.
2010-10-27 11:18:46 -04:00
Kristian Rietveld
d2c6533107 Fix typo in docs 2010-10-17 10:30:46 +02:00
Benjamin Otte
f64e2df911 dnd: Fix gtk_drag_set_icon_surface() with translucent surfaces
The code for surfaces with alpha content was apparently untested and
screwed up the signs.
2010-09-30 16:25:44 +02:00