Commit Graph

110 Commits

Author SHA1 Message Date
Cody Russell
8e142788a5 Bug 608218 - GtkOffscreenWindow causes bad window with GtkEntry
We now exit early from gdk_window_register_dnd() to avoid crashing if the
window type is GDK_WINDOW_OFFSCREEN and does not support dnd operations.
This makes it possible to use any dnd-enabled widgets, such as GtkEntry,
within a GtkOffscreenWindow.
2010-06-01 10:32:18 -05:00
Matthias Clasen
bd4609b140 Merge the xi2-for-master branch 2010-05-25 18:38:44 -04:00
Tadej Borovšak
ff61948d13 Move documentation to inline comments: GdkWindow
Use examples/gdk to store documentation code examples.

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

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-05-14 17:11:51 +02:00
Javier Jardón
8c46ef830b Remove deprecated code from GdkDnd 2010-05-03 01:45:00 +02:00
Javier Jardón
791962e06d Include <X11/Xutil.h> in gdkdnd-x11.c
Otherwise, inclusion of shape.h triggers an unknown type error
for Region, and compile fails, at least in Solaris.

Reported by Philip Brown here:
https://bugzilla.gnome.org/show_bug.cgi?id=615028
2010-04-18 19:54:22 +02:00
Matthias Clasen
9c8dbc292f Minor doc clarification for gdk_drag_begin
Mention that targets is a list of atoms. Bug 611317.
2010-03-08 21:01:30 -05:00
Matthias Clasen
325cbef27e Protect against X errors when clearing the DND cache
This was reported as a problem in bug 609952.
2010-02-23 12:51:44 -05:00
Matthias Clasen
69aa7a6392 Make DND work better with shaped windows
If mouse clicks go through, drag-and-drop should too...
Fixes bug 608615.
2010-02-04 19:18:22 -05:00
Colin Walters
18dc96caf8 Merge in Gdk-custom.c introspection annotations
The Gdk-custom.c file in gir-repository contained a number of
introspection annotations.  Merge those into the GDK source files.

Some documentation was moved from the tmpl/ files to accomodate
the addition of annotations.

https://bugzilla.gnome.org/show_bug.cgi?id=592279
2009-12-16 17:22:01 -02:00
Javier Jardón
7d1c8fa644 [gdk/x11/gdkdnd-x11] Add missing "Deprecated: 2.x" to the api doc comments. 2009-11-06 03:41:02 +01:00
Alexander Larsson
7698daf97a Merge branch 'master' into client-side-windows
Conflicts:
	gdk/x11/gdkwindow-x11.c
2009-05-25 14:30:01 +02:00
Matthias Clasen
96912b564f Avoid another case of treating None as an atom 2009-05-24 00:30:58 -04:00
Alexander Larsson
eabac453e6 Initial client-side-windows work
The history before this was kind of twisted as several different
approaches were tested, so that was all squashed into this initial
commit to hide the uninteresting changes and files that were later
removed.
2009-04-02 10:14:01 +02:00
Matthias Clasen
8ea8b1ee48 Typo fixes and small doc improvements
svn path=/trunk/; revision=21929
2008-12-26 04:20:28 +00:00
Tor Lillqvist
b1e744b064 Bug 544684 - Win64 issue, window handles are assumed to be 32-bit
2008-08-05  Tor Lillqvist  <tml@novell.com>

	Bug 544684 - Win64 issue, window handles are assumed to be 32-bit

	* gdk/gdkdnd.h
	* gdk/gdkdnd.c
	* gdk/win32/gdkdnd-win32.c
	* gdk/x11/gdkdnd-x11.c: Change return value and type of window id
	from guint32 to GdkNativeWindow for
	gdk_drag_get_protocol_for_display() and
	gdk_drag_get_protocol(). This is not an API break on existing
	platforms, as GdkNativeWindow has been guint32 for them
	already.


svn path=/trunk/; revision=20988
2008-08-04 22:35:16 +00:00
Johan Dahlin
d97cdbdf53 Include "config.h" instead of <config.h> Command used: find -name
2008-06-21  Johan Dahlin  <jdahlin@async.com.br>

    * *.[ch]: Include "config.h" instead of <config.h>
    Command used:
    find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g'
    Rubberstamped by Mitch and Tim


svn path=/trunk/; revision=20669
2008-06-22 14:28:52 +00:00
Matthias Clasen
241ff0b6bd Cleanups 2006-10-08 05:32:07 +00:00
Matthias Clasen
bb279057f3 Zero out some stack-allocated X structures, to avoid valgrind warnings
2006-08-15  Matthias Clasen  <mclasen@redhat.com>

        * gdk/x11/gdkdnd-x11.c (gdk_window_register_dnd):
        * gdk/x11/gdkwindow-x11.c (gdk_window_set_decorations):
        (gdk_window_set_functions): Zero out some stack-allocated
        X structures, to avoid valgrind warnings about uninitialized
        memory.  (#349382, David Baron)
2006-08-15 05:46:08 +00:00
Matthias Clasen
02ed1e9bdb Make GTK+ work as an untrusted X client. (#136571, Ed Catmur)
2006-05-25  Matthias Clasen  <mclasen@redhat.com>

	Make GTK+ work as an untrusted X client. (#136571,
	Ed Catmur)
2006-05-25 05:30:14 +00:00
Matthias Clasen
0b98adf31a Always set protocol. (#342003, Tommi Komulainen)
2006-05-18  Matthias Clasen  <mclasen@redhat.com>

	* gdk/x11/gdkdnd-x11.c (_gdk_drag_get_protocol_for_display):
	Always set protocol.  (#342003, Tommi Komulainen)
2006-05-18 18:13:27 +00:00
Matthias Clasen
f22387f042 Remove extraneous ; 2006-05-14 03:58:06 +00:00
Matthias Clasen
10f0736ac7 Use G_DEFINE_TYPE.
2006-04-04  Matthias Clasen  <mclasen@redhat.com>

	* gdk/gdkdisplay.c:
	* gdk/gdkdisplaymanager.c:
	* gdk/gdkdraw.c:
	* gdk/gdkkeys.c:
	* gdk/gdkpixmap.c:
	* gdk/gdkscreen.c:
	* gdk/gdkwindow.c:
	* gdk/x11/gdkcolor-x11.c:
	* gdk/x11/gdkdisplay-x11.c:
	* gdk/x11/gdkdnd-x11.c:
	* gdk/x11/gdkdrawable-x11.c:
	* gdk/x11/gdkgc-x11.c:
	* gdk/x11/gdkimage-x11.c:
	* gdk/x11/gdkinput.c:
	* gdk/x11/gdkpixmap-x11.c:
	* gdk/x11/gdkscreen-x11.c:
	* gdk/x11/gdkwindow-x11.c: Use G_DEFINE_TYPE.

	* gdk/x11/gdkcolor-x11.c:
	* gdk/x11/gdkdnd-x11.c:
	* gdk/x11/gdkimage-x11.c: Use instance private data.
2006-04-04 14:02:03 +00:00
Matthias Clasen
afab67f99a Make drops on the root window work again. (#145243, Andrew S. Dixon)
2006-02-02  Matthias Clasen  <mclasen@redhat.com>

	* gdk/x11/gdkdnd-x11.c (_gdk_drag_get_protocol_for_display):
	Make drops on the root window work again.  (#145243, Andrew S. Dixon)
2006-02-02 20:51:49 +00:00
Matthias Clasen
653a6dd9db Fix #317844 2005-10-26 13:42:53 +00:00
Matthias Clasen
9a5d4a2ff9 Various cleanups. (#315359, Kjartan Maraas)
2005-09-13  Matthias Clasen  <mclasen@redhat.com>

	* gdk/*.c: Various cleanups.  (#315359, Kjartan Maraas)
2005-09-13 19:14:51 +00:00
Matthias Clasen
1f700be359 Broken pipe 2005-09-11 05:40:51 +00:00
Matthias Clasen
476e138db0 Intern type names before registering the type to avoid unnecessary copies.
2005-08-31  Matthias Clasen  <mclasen@redhat.com>

	* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_get_type):
	* gdk/x11/gdkscreen-x11.c (_gdk_screen_x11_get_type):
	* gdk/x11/gdkpixmap-x11.c (gdk_pixmap_impl_x11_get_type):
	* gdk/x11/gdkkeys-x11.c (gdk_keymap_x11_get_type):
	* gdk/x11/gdkinput.c (gdk_device_get_type):
	* gdk/x11/gdkimage-x11.c (gdk_image_get_type):
	* gdk/x11/gdkgc-x11.c (_gdk_gc_x11_get_type):
	* gdk/x11/gdkdrawable-x11.c (_gdk_drawable_impl_x11_get_type):
	* gdk/x11/gdkdnd-x11.c (gdk_drag_context_get_type):
	* gdk/x11/gdkdisplay-x11.c (_gdk_display_x11_get_type):
	* gdk/x11/gdkcolor-x11.c (gdk_colormap_get_type):
	* gdk/gdkwindow.c (gdk_window_object_get_type):
	* gdk/gdkscreen.c (gdk_screen_get_type):
	* gdk/gdkrectangle.c (gdk_rectangle_get_type):
	* gdk/gdkpixmap.c (gdk_pixmap_get_type):
	* gdk/gdkkeys.c (gdk_keymap_get_type):
	* gdk/gdkfont.c (gdk_font_get_type):
	* gdk/gdkevents.c (gdk_event_get_type):
	* gdk/gdkdraw.c (gdk_drawable_get_type):
	* gdk/gdkdisplaymanager.c (gdk_display_manager_get_type):
	* gdk/gdkdisplay.c (gdk_display_get_type):
	* gdk/gdkcursor.c (gdk_cursor_get_type):
	* gdk/gdkcolor.c (gdk_color_get_type): Intern type names before
	registering the type to avoid unnecessary copies.
2005-08-31 15:14:26 +00:00
Matthias Clasen
933b1f4546 After checking XLib sources, XGetWindowProperty does set data to NULL. 2005-08-19 13:46:11 +00:00
Matthias Clasen
859126d546 Free data returned from XGetWindowProperty.
2005-08-19  Matthias Clasen  <mclasen@redhat.com>

	* gdk/x11/gdkdnd-x11.c (_gdk_drag_get_protocol_for_display)
	(xdnd_read_actions, get_client_window_at_coords_recurse):
	Free data returned from XGetWindowProperty.

	* gdk/x11/gdkevents-x11.c (fetch_net_wm_check_window)
	Free data returned from XGetWindowProperty.  (313867, Kjartan
	Maraas)

	* gdk/x11/gdkdnd-x11.c (get_client_window_at_coords_recurse): Free
	children in all cases.  (#313862, Kjartan Maraas)
2005-08-19 05:46:06 +00:00
Matthias Clasen
ba8fd4b9e2 Free children in all cases. (#313862, Kjartan Maraas)
2005-08-19  Matthias Clasen  <mclasen@redhat.com>

	* gdk/x11/gdkdnd-x11.c (get_client_window_at_coords_recurse): Free
	children in all cases.  (#313862, Kjartan Maraas)
2005-08-19 05:16:31 +00:00
Matthias Clasen
9c3aa23e08 Set the time field in the event. (#308573, Morten Welinder)
2005-06-22  Matthias Clasen  <mclasen@redhat.com>

	* gdk/x11/gdkdnd-x11.c (xdnd_finished_filter): Set the
	time field in the event.  (#308573, Morten Welinder)
2005-06-22 16:09:41 +00:00
Matthias Clasen
13a9dd210a Update the user time on the window when a drop happens. (#169364,
2005-06-09  Matthias Clasen  <mclasen@redhat.com>

	* gdk/x11/gdkdnd-x11.c (motif_drop_start, xdnd_drop_filter): Update
	the user time on the window when a drop happens.  (#169364, Alexander
	Hunziker, patch by Elijah Newren)
2005-06-09 17:13:58 +00:00
Matthias Clasen
2a2d769d42 Make PLT-reduction work with gcc4, and don't include everything in
2005-03-15  Matthias Clasen  <mclasen@redhat.com>

	Make PLT-reduction work with gcc4, and don't include
	everything in gdkalias.h:

	* gdk/gdk.symbols: Group symbols by header and source file.
	* gdk/makegdkalias.pl: Protect definitions by the same
	preprocessor symbols used to guard the headers. Move
	the alias declarations to a separate file which is
	produced when calling makegdkalias.pl -def
	* gdk/Makefile.am (gdkaliasdef.c): Add a rule to generate this
	file.
	* gdk/*.c, gdk/x11/*.c: Include gdkalias.h after the other
	headers, include gdkaliasdef.c at the bottom.
2005-03-16 03:17:27 +00:00
Matthias Clasen
6da29b43a6 gdk/gdkkeyuni.c gdk/gdkpixbuf-drawable.c gdk/gdkrgb.c gdk/x11/gdkdnd-x11.c
2005-03-01  Matthias Clasen  <mclasen@redhat.com>

	* gdk/gdkkeyuni.c
	* gdk/gdkpixbuf-drawable.c
	* gdk/gdkrgb.c
	* gdk/x11/gdkdnd-x11.c
	* gdk/x11/gdkevents-x11.c
	* gdk/x11/gdkproperty-x11.c
	* gdk/x11/gdkvisual-x11.c
	* gdk-pixbuf/gdk-pixbuf.c
	* gtk/gtkaction.c
	* gtk/gtkbindings.c
	* gtk/gtkcolorbutton.c
	* gtk/gtkcombo.c
	* gtk/gtkcontainer.c
	* gtk/gtkfilechooserdefault.c
	* gtk/gtkfilesel.c
	* gtk/gtkgamma.c
	* gtk/gtkiconview.c
	* gtk/gtkinputdialog.c
	* gtk/gtkitemfactory.c
	* gtk/gtkmenu.c
	* gtk/gtktextview.c
	* gtk/gtktooltips.c
	* gtk/gtktreedatalist.c
	* gtk/gtkuimanager.c
	* gtk/tree_minus.xpm
	* gtk/tree_plus.xpm
	* gtk/xdgmime/xdgmime.c
	* gtk/xdgmime/xdgmime.h:
	Move constant data to .rodata.
2005-03-01 06:25:55 +00:00
Owen Taylor
f266788e19 Squash strict aliasing warnings.
Tue Nov 16 19:26:30 2004  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkdnd-x11.c (_gdk_drag_get_protocol_for_display):
        Squash strict aliasing warnings.
2004-11-17 00:55:10 +00:00
Matthias Clasen
669d068594 Handle the case that the protocol version in the context is not set yet.
2004-11-03  Matthias Clasen  <mclasen@redhat.com>

	* gdk/x11/gdkdnd-x11.c (gdk_drag_motion): Handle the
	case that the protocol version in the context is not
	set yet.  (#157123, James Henstridge)
2004-11-03 17:06:38 +00:00
Matthias Clasen
d5f92150d4 Fix many sparse warnings. 2004-10-28 15:00:05 +00:00
Matthias Clasen
6d5398ccdc Remove debug spew.
Tue Aug 31 23:20:58 2004  Matthias Clasen  <maclas@gmx.de>

	* gdk/x11/gdkdnd-x11.c (gdk_drop_finish): Remove debug spew.
2004-09-01 03:21:30 +00:00
Matthias Clasen
0742ff3ae3 Add hidden aliases for exported symbols which are used internally in order
Mon Aug  9 15:41:17 2004  Matthias Clasen  <maclas@gmx.de>

	Add hidden aliases for exported symbols which are
	used internally in order to get rid of many PLT
	entries.  (#145519, Arjan van de Ven)

	* gdk/Makefile.am: Add rules to generate gdk.def and
	gdkalias.h from gdk.symbols, and make make check check
	the abi with abicheck.sh.

	* gdk/gdk.symbols: New file. Definition of the GDK ABI.
	The file can be processed by cpp to filter out certain
	subsets of symbols.

	* gdk/abicheck.sh: New file. Script to check the actually
	symbols exported from libgdk-x11.2.0.so against the symbols
	found in gdk.symbols.

	* gdk/makegdkalias.pl: New file. Perl script to generate the
	header containing the alias definitions for internally used
	exported symbols from a list of symbols.

	* gdk/*.c, gdk/x11/*.c: Include gdkalias.h
2004-08-09 20:14:43 +00:00
Morten Welinder
2f7c4c1e10 Fix C99ism.
2004-08-09  Morten Welinder  <terra@gnome.org>

	* gdk/x11/gdkdnd-x11.c (gdk_drag_drop_succeeded): Fix C99ism.
2004-08-09 19:58:05 +00:00
Matthias Clasen
39469f8f4a Really fix the initialization of the target list.
2004-08-06  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkdnd.c (gtk_drag_dest_set, gtk_drag_source_set): Really
	fix the initialization of the target list.

	Support XDND v5. (#10220, Owen Taylor)

	* gdk/x11/gdkdnd-x11.c: Record the XDND version and whether the
	drop was successful in the GdkDragContextPrivateX11 struct.
	(xdnd_finished_filter): Store the success status of the drop
	for an XDND version 5 interaction. For other versions, always
	assume the drop was successful.
	(xdnd_check_dest): Return the protocol version.
	(_gdk_drag_get_protocol_for_display): Return the protocol version.
	(gdk_drag_find_window_for_screen): Store the used protocol version
	in the GdkDragContext.
	(xdnd_send_enter): Send the used protocol version from the context,
	instead of hardwiring 3.
	(xdnd_enter_filter): Accept protocol versions >= 3 and store the
	used protocol version in the context.

	* gdk/gdkdnd.h:
	* gdk/x11/gdkdnd-x11.c (gdk_drag_drop_succeeded): New function
	to find out whether a drop was successful.
2004-08-06 17:03:52 +00:00
Matthias Clasen
601ef659f4 Fix a warning message. 2004-07-17 05:18:09 +00:00
Federico Mena Quintero
097eddf374 Fix typo; tmp_event -> temp_event.
2004-07-09  Federico Mena Quintero  <federico@ximian.com>

	* gdk/x11/gdkdnd-x11.c (xdnd_send_xevent): Fix typo; tmp_event ->
	temp_event.
2004-07-09 17:43:10 +00:00
Matthias Clasen
9ab68256d1 Don't leak references to the drag context. (#144324, Alex Larsson)
2004-07-08  Matthias Clasen  <mclasen@redhat.com>

	* gdk/x11/gdkdnd-x11.c (xdnd_send_xevent): Don't leak
	references to the drag context.  (#144324, Alex Larsson)
2004-07-08 20:29:19 +00:00
Federico Mena Quintero
80581c3011 Fixes #136082 and #135265, patch by Morten Welinder.
2004-03-05  Federico Mena Quintero  <federico@ximian.com>

	Fixes #136082 and #135265, patch by Morten Welinder.

	* configure.in: Use AC_SYS_LARGEFILE.

	* */*.c: #include <config.h>
2004-03-06 03:38:59 +00:00
Owen Taylor
8500d9458e Change _gdk_x11_send_xevent_async() to
Tue Jul  8 17:36:21 2003  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkasync.[ch] gdk/gdkdnd-x11.c:
        Change _gdk_x11_send_xevent_async() to
        _gdk_x11_send_client_message_async() avoid using Xlib
        internals that are different on Solaris.
        (#116917, Morten Welinder)
2003-07-08 22:27:47 +00:00
Owen Taylor
ba999da1d8 Lookup all the atoms in the target list at once.
Sat Jul  5 09:55:38 2003  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkdnd-x11.c (precache_target_list): Lookup
        all the atoms in the target list at once.

        * gdk/x11/gdkdnd-x11.c (gdk_drag_get_protocol_for_display):
        Local drag short-circuit.

        * gdk/x11/gdkdnd-x11.c (gdk_drag_motion): For the
        local case, poke the actions in directly instead of
        going through xdnd_set_actions.

        * gdk/x11/gdkdnd-x11.c (xdnd_read_actions): Short-circuit
        the local case.

        * gdk/x11/gdkdnd-x11.c (xdnd_manage_source_filter): Don't
        XSelectInput()/add a filter if the drag is local.

        * gdk/x11/gdkdnd-x11.c (gdk_drag_get_selection):
        Simplify handling of "XdndSelection".

        * gdk/x11/gdkevents-x11.c (gdk_event_send_client_message_to_all_recurse): Somehow,
        a WM_STATE => _NET_WM_STATE change hand been made here.

        * gdk/x11/gdkproperty-x11.c (_gdk_x11_precache_atoms): Free
        xatom_names, not atom_names.

        * tests/testdnd.c (target_drag_motion): Make the trashcan
        open again. (Got lost in deprecation cleanup.)
2003-07-05 15:02:35 +00:00
Owen Taylor
58a7f9f72a Function to get a range of information about all the children of a window
Fri Jul  4 23:49:22 2003  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkasync.[ch] (_gdk_x11_get_window_child_info):
        Function to get a range of information about all the
        children of a window in a single pass.

        * gdk/x11/gdkdnd-x11.c (get_client_window_at_coords_recurse)
        gdk/x11/gdkdnd-x11.c (gdk_window_cache_new): Use
        _gdk_x11_get_window_child_info() to greatly reduce
        the number of roundtrips.
2003-07-05 04:22:06 +00:00
Owen Taylor
60149b3275 Add a function to XSendEvent() and call a calback on failure/success.
Fri Jul  4 22:57:18 2003  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkasync.[ch] (_gdk_send_xevent_async): Add
        a function to XSendEvent() and call a calback on
        failure/success.

        * gdk/x11/gdkdnd-x11.c (xdnd_send_xevent): Short-circuit
        messages to the same process, use _gdk_send_xevent_async().
2003-07-05 03:02:21 +00:00
Owen Taylor
85d8c33706 Use application/x-rootwindow-drop for root window drops. (#108670, Alex
Sun Jun  8 22:03:09 2003  Owen Taylor  <otaylor@redhat.com>

        * tests/testdnd.c: Use application/x-rootwindow-drop for
        root window drops. (#108670, Alex Larsson)

        * gdk/x11/gdkdnd-x11.c (gdk_drag_motion) gtk/gtkdnd.c (gtk_drag_drop):
        Accept either application/x-rootwin-drop (what GTK+ has always used)
        or application/x-rootwindow-drop (what the XDND standard specifies).
2003-06-09 02:13:42 +00:00