1. 30 Nov, 2017 1 commit
    • Руслан Ижбулатов's avatar
      GDK W32: Preserve the target value for change_property() · 56074fbf
      Руслан Ижбулатов authored
      We need to know the target atom value to know when we need to
      do something with side-effects (since side-effects are expressed via
      special target values). Previously, the code side-stepped that by looking
      at the data type (which was rather unique for the one side-effect
      target that we supported, signalled by the TARGETS target),
      but for the DELETE target that seems to be no longer an option, hence the new
      field to carry this information past the convert_selection() routine.
      
      This prevents GDK from throwing a warning when trying to convert
      a DELETE target, which has no format or data objects set.
      
      The side-effects for the DELETE target happen earlier, in GTK layer.
      By the point it gets to change_property(), it's a no-op.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=786509
      56074fbf
  2. 25 Nov, 2017 2 commits
    • Руслан Ижбулатов's avatar
      GDK W32: Ensure that selection request is processed · 934ac3f6
      Руслан Ижбулатов authored
      To do that, run the message loop for one second or until the side-effect
      of running the selection request handler is achieved (as opposed to
      running it until the event is no longer queued).
      
      The disavantage of this method is that if the event handling is
      somehow missed (due to a variety of reasons - after all, it's not
      a straight path from an event being queued to property_change()
      being called), this will loop for one second. Since we do process
      events during that time, this will not hang the application, but
      might still restrict some of the functionality.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=786509
      934ac3f6
    • Руслан Ижбулатов's avatar
      W32: Massive W32 DnD fix · 8caba953
      Руслан Ижбулатов authored
      Massive changes to OLE2 DnD protocol, which was completely broken before:
      * Keep GdkDragContext and OLE2 objects separate (don't ref/unref them
        together, don't necessarily create them together).
      * Keep IDataObject formats in the object itself, not in a global variable.
      * Fix getdata() to look up the request target in its format list, not in the
        global hash table
      * Create target GdkDragContext on each drag_enter, destroy it on drag_leave,
        whereas IDropTarget is created when a window becomes a drag destination
        and is re-used indefinitely.
      * Query the source IDataObject for its supported types, cache them in the
        target (!) context. This is how GTK+ works, honestly.
      * Remember current_src_object when we initiate a drag, to be able
        to detect later on that the data object is ours and use a
        shortcut when querying targets
      * Make sure GDK_DRAG_MOTION is only sent when something changes
      * Support GTK drag cursors
      * Ensure that exotic GTK clipboard formats are registered
        (but try to avoid registering formats that can't be used between applications).
      * Don't enumerate internal formats
      * Ensure that DnD indicator window can't accept drags or receive any kind of input
        (use WS_EX_TRANSPARENT).
      * Remove unneeded indentation in _gdk_win32_dnd_do_dragdrop()
      * Fix indentation in gdk_win32_drag_context_drop_finish()
      * Remove obsolete comments in _gdk_win32_window_register_dnd()
      * Check for DnD in progress when processing WM_KILLFOCUS, don't emit a grab
        break event in such cases (this allows alt-tabbing while DnD is in progress,
        though there may be lingering issues with focus after dropping...)
      * Support Shell ID List -> text/uri-list conversion, now it's possible
        to drop files (dragged from Explorer) on GTK+ applications
      * Explicitly use RegisterClipboardFormatA() when we know that the string
        is not in unicode. Otherwise explicitly use RegisterClipboardFormatW()
        with a UTF8->UTF16 converted string
      * Fix _gdk_win32_display_get_selection_owner() to correctly bail
        when selection owner HWND is NULL (looking up GdkWindow for NULL
        HWND always succeeds and returns the root window - not the intended
        effect)
      * More logging
      * Send DROP_FINISHED event after DnD loop ends
      * Send STATUS event on feedback
      * Move GetKeyboardState() and related code into _gdk_win32_window_drag_begin(),
        so that it's closer to the point where last_pt and start_pt are set
      * Use & 0x80 to check for the key being pressed. Windows will set low-order bit
        to 1 for all mouse buttons to indicate that they are toggled, so simply
        checking for the value not being 0 is not enough anymore.
        This is probably a new thing in modern W32 that didn't exist before
        (OLE2 DnD code is old).
      * Fixed (hopefully) and simplified HiDPI parts of the code.
      
      Also adds managed DnD implementation for W32 GDK backend (for both
      OLE2 and LOCAL protocols). Mostly a copy of the X11 backend code, but
      there are some minor differences:
      * doesn't use drag_window field in GdkDragContext,
        uses the one in GdkWin32DragContext exclusively
      * subtracts hotspot offset from the window coordinates when showing
        the dragback animation
      * tries to consistently support scaling and caches the scale
        in the context
      * Some keynav code is removed (places where grabbing/ungrabbing should
        happen is marked with TODOs), and the rest is probably inert.
      
      Also significantly changes the way selection (and clipboard) is handled
      (as MSDN rightly notes, the handling for DnD and Clipboard
       formats is virtually the same, so it makes sense to handle
       both with the same code):
      * Don't spam GDK_OWNER_CHANGE, send them only when owner
        actually changes
      * Open clipboard when our process becomes the clipboard owner
        (we are doing it anyway, to empty the clipboard and *become* the owner),
        and then don't close it until a scheduled selection request event
        (with TARGETS target) is received. Process that event by announcing
        all of our supported formats (by that time add_targets() should have
        been called up the stack, thus the formats are known; just in case,
        add_targets() will also schedule a selection request, if one isn't
        scheduled already, so that late-coming formats can still be announced).
      * Allow clipboard opening for selection_convert() to be delayed if it
        fails initially.
      * The last two points above should fix all the bugs about GTK+ rising
        too much ruckus over OpenClipboard() failures, as owner change
        *is allowed* to fail (though not all callers currently handle
        that case), and selection_convert() is asynchronous to begin with.
        Still, this is somewhat risky, as there's a possibility that the
        code will work in unexpected ways and the clipboard will remain open.
        There's now logging to track the clipboard being opened and closed,
        and a number of failsafes that try to ensure that it isn't kept open
        for no reason.
      * Added copious notes on the way clipboard works on X11, Windows and GDK-W32,
        also removed old comments in DnD implementation, replaced some of them
        with the new ones
      * A lot of crufty module-global variables are stuffed into a singleton
        object, GdkWin32Selection. It's technically possible to make it a
        sub-object of the Display object (the way Wayland backend does),
        but since Display object on W32 is a singleton anyway... why bother?
      * Fixed the send_change_events() a bit (was slightly broken in one of the
        previous iterations)
      * Ensure that there's no confusion between selection conversion (an artifact
        term from X11) and selection transmutation (changing the data to be W32-compatible)
      * Put all the transmutation code and format-target-matching code into gdkselection-win32.c,
        now this code isn't spread across multiple files.
      * Consequently, moved some code away from gdkproperty-win32.c and gdkdnd-win32.c
      * Extensive format transmutation checks for OLE2 DnD and clipboard.
        We now keep track of which format mappings are for transmutations,
        and which aren't (for example, when formats are passed as-is, or when
        a registered name is just an alias)
      * Put transmutation code into separate functions
      
      * Ensure that drop target keeps a format->target map for supported formats,
        this is useful when selection_convert() is called, as it only receives a
        single target and no hints on the format from which the data should
        be transmuted into this target.
      * Add clear_targets() on W32, to de called by GTK
      * Use g_set_object() instead of g_ref_object() where it is allowed.
      * Fix indentation (and convert tabs to spaces), remove unused variables
      
      https://bugzilla.gnome.org/show_bug.cgi?id=786509
      8caba953
  3. 26 Mar, 2016 1 commit
  4. 22 Feb, 2016 1 commit
  5. 15 Jan, 2016 1 commit
  6. 16 Oct, 2015 1 commit
  7. 29 Apr, 2015 1 commit
  8. 13 Aug, 2014 1 commit
  9. 16 May, 2014 1 commit
  10. 24 Apr, 2014 1 commit
    • Marc-André Lureau's avatar
      win32: add more clipboard data checks to avoid crash · 2230fea0
      Marc-André Lureau authored
      It may happen that the received clipboard data is empty, but
      if it's of type image/bmp, gtk+ will crash:
      
      gdk_property_change: 00030AD4 GDK_SELECTION image/bmp REPLACE 8*0 bits:
      ... delayed rendering
      gdk_selection_send_notify_for_display: 00030AD4 CLIPBOARD image/bmp
      GDK_SELECTION (no-op)
      _gdk_win32_selection_convert_to_dib: 1252003C image/bmp
      
      Program received signal SIGSEGV, Segmentation fault.
      0x749a9f40 in msvcrt!memmove () from C:\Windows\syswow64\msvcrt.dll
      
      Thread 1 (Thread 2248.0x1b34):
      target=0xc07b) at gdkselection-win32.c:1292
      at gdkevents-win32.c:3498
      wparam=8, lparam=0) at gdkevents-win32.c:232
      message=773, wparam=8, lparam=0)
          at gdkevents-win32.c:263
      C:\Windows\syswow64\user32.dll
      C:\Users\rugoosse\AppData\Local\virt-viewer\bin\libpangocairo-1.0-0.dll
      wparam=0, lparam=-1687549457)
          at gdkevents-win32.c:248
      C:\Users\rugoosse\AppData\Local\virt-viewer\bin\libpangocairo-1.0-0.dll
      
      https://bugzilla.gnome.org/show_bug.cgi?id=728745
      2230fea0
  11. 09 Nov, 2013 1 commit
    • Marc-André Lureau's avatar
      gdk/win32: remove extra allocation for \r removal · c486c098
      Marc-André Lureau authored
      Although I can't find explicit documentation for clipboard pointer, it
      seems to be possible to modify clibpoard memory without side-effects.
      
      According to MSDN,
      http://msdn.microsoft.com/en-us/library/windows/desktop/aa366596%28v=vs.85%29.aspx
      
      "The global and local functions are supported for porting from 16-bit
      code, or for maintaining source code compatibility with 16-bit
      Windows. Starting with 32-bit Windows, the global and local functions
      are implemented as wrapper functions that call the corresponding heap
      functions using a handle to the process's default heap."
      
      "Memory objects allocated by GlobalAlloc and LocalAlloc are in private,
      committed pages with read/write access that cannot be accessed by other
      processes. Memory allocated by using GlobalAlloc with GMEM_DDESHARE is
      not actually shared globally as it is in 16-bit Windows. This value has
      no effect and is available only for compatibility. "
      
      https://bugzilla.gnome.org/show_bug.cgi?id=711553
      c486c098
  12. 27 Feb, 2012 1 commit
  13. 10 Nov, 2011 3 commits
  14. 06 Feb, 2011 1 commit
  15. 02 Jan, 2011 1 commit
    • Hans Breuer's avatar
      win32: gdk3 resurrection · 1d838f58
      Hans Breuer authored
      There are sure regressions but basic stuff seems to be working
      again after all the API breakage done with comments like
      "Win32 and Quartz need to be ported still."
      1d838f58
  16. 04 Apr, 2010 2 commits
    • Tor Lillqvist's avatar
      Work on OLE2-based generic DND · af37f76b
      Tor Lillqvist authored
      Intermediate commit of work in progress on integrating the old code
      for OLE2-based generic drag and drop from Arhaeopteryx Software, from
      a long time ago in the GTK+ 1.3 timeframe. Does still not work and is
      as before not compiled in unless OLE2_DND is defined in
      gdkdnd-win32.c. (Thus, for inter-process DND, still only WM_DROPFILES
      style dropping of files on GTK+ apps works.)
      
      Related slight refactoring of other code that shouldn't change how it
      works. Add more global variables for run-time constants (once
      initialized) representing well-known GdkAtoms and registered Windows
      clipboard formats, as they with the generic DND code will be needed in
      several source files. Some improved debugging output.
      af37f76b
    • Tor Lillqvist's avatar
      Make more GdkAtom variables visible in all gdk/win32 files · e5b4a51b
      Tor Lillqvist authored
      Make the GdkAtoms for the image formats extern and usable from all
      gdk/win32 files.
      e5b4a51b
  17. 16 Dec, 2009 2 commits
    • Tor Lillqvist's avatar
      Work on OLE2-based generic DND · eb21a7df
      Tor Lillqvist authored
      Intermediate commit of work in progress on integrating the old code
      for OLE2-based generic drag and drop from Arhaeopteryx Software, from
      a long time ago in the GTK+ 1.3 timeframe. Does still not work and is
      as before not compiled in unless OLE2_DND is defined in
      gdkdnd-win32.c. (Thus, for inter-process DND, still only WM_DROPFILES
      style dropping of files on GTK+ apps works.)
      
      Related slight refactoring of other code that shouldn't change how it
      works. Add more global variables for run-time constants (once
      initialized) representing well-known GdkAtoms and registered Windows
      clipboard formats, as they with the generic DND code will be needed in
      several source files. Some improved debugging output.
      eb21a7df
    • Tor Lillqvist's avatar
      Make more GdkAtom variables visible in all gdk/win32 files · c196ac2b
      Tor Lillqvist authored
      Make the GdkAtoms for the image formats extern and usable from all
      gdk/win32 files.
      c196ac2b
  18. 23 Oct, 2009 1 commit
  19. 15 Feb, 2009 1 commit
    • Tor Lillqvist's avatar
      Bug 571873 - Compile error with gdk/win32/gdkselection-win32.c · b62e3113
      Tor Lillqvist authored
      2009-02-16  Tor Lillqvist  <tml@novell.com>
      
      	Bug 571873 - Compile error with gdk/win32/gdkselection-win32.c
      
      	* gdk/win32/gdkselection-win32.c (gdk_selection_convert): Cast
      	gpointer to char * before pointer arithmetic to avoid compilation
      	error with MSVC.
      
      	(_gdk_selection_property_delete): Remove unused variable.
      
      
      svn path=/trunk/; revision=22337
      b62e3113
  20. 30 Jan, 2009 1 commit
    • Tor Lillqvist's avatar
      Bug 559408 - Transparency lost when images are copied between GTK+ and the · 3f4c73d0
      Tor Lillqvist authored
      2009-01-29  Tor Lillqvist  <tml@novell.com>
      
      	Bug 559408 - Transparency lost when images are copied between GTK+
      	and the clipboard on Windows
      
      	The code in gdkselection-win32.c is simplified quite a lot. When
      	an image is stored on the clipboard from GTK+, only the "PNG" and
      	CF_DIB formats are advertised. PNG is our preferred format because
      	it can losslessly represent any image that gdk-pixbuf can handle,
      	even with alpha, unambiguously. CF_DIB is also advertised because
      	of its ubiquitous support in Windows software.
      
      	Delayed rendering is used as before, so for other data than text
      	nothing is actually stored on the clipboard until some app asks
      	for it.
      
      	It's pointless to advertise images formats like "image/png" or
      	"image/x-MS-bmp" that no other Windows application is going to
      	look for anyway. Likewise it's pointless to store text under
      	formats like "text/plain" or "UTF8_STRING". Just store
      	CF_UNICODETEXT. CF_TEXT will be available as a synthesized format
      	anyways.
      
      	Office 2007 offers and asks for images in PNG format using the
      	registered clipboard format name "PNG", so we do likewise. If the
      	"PNG" format is available that is preferred when copying to GTK+
      	from the clipboard.
      
      	Unfortunately Word 2007 still uses CF_DIB without handling
      	alpha. But PowerPoint 2007 uses PNG if available and handles alpha
      	correctly. Both Word and Powerpoint offer PNG with alpha nicely.
      
      	Firefox and IE7 offer images that contain alpha as 32-bit version
      	3 BI_RGB DIBs with the undocumented "extra" bytes actually being
      	alpha. Also, alpha is premultiplied into the RGB bytes, presumably
      	because that is how AlphaBlend() wants such DIBs. That is also
      	taken care of. At least for Firefox it easy to be sure that a
      	CF_DIB on the clipboard is from Firefox.
      
      	Also some general stylistic cleanup, comment improvements, and
      	improvements of debugging printout especially in the clipboard
      	handling. Those are not detailled below.
      
      	* gdk/win32/gdkprivate-win32.h
      	* gdk/win32/gdkglobals-win32.c
      	* gdk/win32/gdkgmain-win32.c: Move some globals that were used
      	only in gdkselection-win32.c to be local to that file.
      
      	* gdk/win32/gdkproperty-win32.c (gdk_property_change): Don't
      	bother checking if text to be placed on the clipboard consists of
      	only ASCII.
      
      	* gdk/win32/gdkselection-win32.c: Add static variables for a list
      	of GdkPixbuf-supported formats, well-known registered clipboard
      	formats for images, and for GdkAtoms for well-known image and text
      	formats.
      
      	(_gdk_win32_selection_init): Initialize above static variables.
      
      	(selection_property_store) (gdk_selection_property_get)
      	(_gdk_selection_property_delete): Don't use a FIFO of GdkSelProps
      	for a window after all, it breaks testtext. See bug #163844.
      
      	(gdk_selection_convert): When converting to the TARGETS format,
      	i.e. when the caller wants to know what clipboard formats are
      	available, if PNG is available we report just that and skip
      	CF_DIB, JPEG and GIF even if advertised.
      
      	If CF_UNICODETEXT is available, report only UTF8_STRING.
      
      	When converting to the UTF8_STRING format, i.e. when the caller
      	wants text from the clipboard, try just CF_UNICODETEXT. There is
      	no point in trying CF_TEXT as Windows will synthesize
      	CF_UNICODETEXT from CF_TEXT anyway, if some app has stored just
      	CF_TEXT.
      
      	When converting to the image/bmp format, i.e. when the caller
      	wants an CF_DIB image from the clipboard, we check if the DIB is a
      	version 3 32-bit BI_RGB one that is likely to actually contain
      	alpha in the "extra" bytes. Such a DIB is likely to have
      	premultiplied alpha even, at least in the case of Firefox 3 and
      	IE7. We then edit the DIB in-place into a version 5 one in
      	BI_BITFIELDS format and undo the alpha premultiplication.
      
      	In any case, prepend a BMP file header before letting go of the
      	data which will be fed to the gdk-pixbuf bmp loader by upper
      	levels.
      
      	(gdk_win32_selection_add_targets): If some kind of pixmap image
      	format is being added, actually advertise just PNG and
      	CF_DIB. Note that alpha won't be stored on the clipboard through
      	CF_DIB. This is because gdk-pixbuf's bmp loader doesn't save
      	alpha. Furthermore, few if any non-GTK+ Windows apps seem to
      	understand a version 5 DIB with proper alpha anyway.
      
      	(_gdk_win32_selection_convert_to_dib): Simplified muchly.
      
      
      
      svn path=/trunk/; revision=22255
      3f4c73d0
  21. 11 Jan, 2009 1 commit
    • Tor Lillqvist's avatar
      Bug 523554 - Copy from GIMP to Word broken · bb56a0a1
      Tor Lillqvist authored
      2009-01-11  Tor Lillqvist  <tml@iki.fi>
      
      	Bug 523554 - Copy from GIMP to Word broken
      
      	* gdk/win32/gdkselection-win32.c
      	(_gdk_win32_selection_convert_to_dib): The DIB stored in the
      	Windows Clipboard was for some unknown reason truncated by one
      	byte. Don't do that.
      
      
      svn path=/trunk/; revision=22086
      bb56a0a1
  22. 04 Aug, 2008 1 commit
    • Tor Lillqvist's avatar
      Bug 544684 - Win64 issue, window handles are assumed to be 32-bit · f4d9ce22
      Tor Lillqvist authored
      2008-08-05  Tor Lillqvist  <tml@novell.com>
      
      	Bug 544684 - Win64 issue, window handles are assumed to be 32-bit
      
      	* gdk/gdkselection.h
      	* gdk/gdkselection.c
      	* gdk/win32/gdkselection-win32.c
      	* gdk/x11/gdkselection-x11.c: Change type of the requestor
      	window id parameter of gdk_selection_send_notify_for_display()
      	and gdk_selection_send_notify() from guint32 to
      	GdkNativeWindow.
      
      	* gdk/win32/gdkselection-win32.c: Add some guchar and char pointer
      	casts to get rid of gcc 4.4 warnings. Print GdkAtom values in
      	debugging output using the %p format.
      
      
      svn path=/trunk/; revision=20991
      f4d9ce22
  23. 22 Jun, 2008 1 commit
    • Johan Dahlin's avatar
      Include "config.h" instead of <config.h> Command used: find -name · d97cdbdf
      Johan Dahlin authored
      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
      d97cdbdf
  24. 15 Jun, 2008 1 commit
    • Cody Russell's avatar
      Initialize hwnd to NULL. This fixes OpenClipboard() failure and, according · 472ea19b
      Cody Russell authored
      2008-06-14  Cody Russell  <bratsche@gnome.org>
      
              * gdk/win32/gdkselection-win32.c (gdk_win32_selection_add_targets):
      
              Initialize hwnd to NULL.  This fixes OpenClipboard() failure and,
              according to MSDN docs, associates the open clipboard with the
              current task.  (#378158, reported by Andreas Köhler)
      
      
      svn path=/trunk/; revision=20388
      472ea19b
  25. 12 May, 2008 1 commit
    • Tor Lillqvist's avatar
      Bug 532059 - Leak in win32 clipboard manipulation · 40ae6fc8
      Tor Lillqvist authored
      2008-05-12  Tor Lillqvist  <tml@novell.com>
      
      	Bug 532059 - Leak in win32 clipboard manipulation
      
      	* gdk/win32/gdkselection-win32.c
      	(gdk_win32_selection_add_targets): Plug memory leak. Patch by
      	Daniel Atallah.
      
      
      svn path=/trunk/; revision=20092
      40ae6fc8
  26. 29 Aug, 2006 1 commit
    • Tor Lillqvist's avatar
      Remove support for Windows 9x/ME. GTK+ hasn't worked on Win9x since 2.6 or · 1ff434a6
      Tor Lillqvist authored
      2006-08-29  Tor Lillqvist  <tml@novell.com>
      
      	Remove support for Windows 9x/ME. GTK+ hasn't worked on Win9x
      	since 2.6 or 2.8. It's pointless to keep the Win9x code in here as
      	it isn't being maintained anyway. If somebody is interested, it
      	can always be found in older GTK+ versions, and in CVS.
      
      	* gdk/win32/gdkcursor-win32.c
      	* gdk/win32/gdkdnd-win32.c
      	* gdk/win32/gdkdrawable-win32.c
      	* gdk/win32/gdkgc-win32.c
      	* gdk/win32/gdkglobals-win32.c
      	* gdk/win32/gdkkeys-win32.c
      	* gdk/win32/gdkmain-win32.c
      	* gdk/win32/gdkproperty-win32.c
      	* gdk/win32/gdkselection-win32.c: Remove the G_WIN32_IS_NT_BASED()
      	and G_WIN32_HAVE_WIDECHAR_API() tests and their false (Win9x)
      	branches, and any variables or static functions used only by the
      	Win9x branches.
      
      	* gdk/win32/gdkprivate-win32.h: Remove backup definitions for
      	constants that aren't missing from current mingw and MSVC6
      	headers.
      
      	* gdk/win32/gdkmain-win32.c
      	* gdk/win32/gdkprivate-win32.h: Remove the _gdk_win32_gdi_failed()
      	function. On NT-based Windows GetLastError() returns error codes
      	also for failed GDI calls, so we can use _gdk_win32_api_failed()
      	always.
      1ff434a6
  27. 01 Nov, 2005 1 commit
    • Tor Lillqvist's avatar
      gdk/win32/gdkprivate-win32.h gdk/win32/gdkglobals-win32.c Add more · 4d1b5589
      Tor Lillqvist authored
      2005-11-01  Tor Lillqvist  <tml@novell.com>
      
      	* gdk/win32/gdkprivate-win32.h
      	* gdk/win32/gdkglobals-win32.c
      	* gdk/win32/gdkmain-win32.c (_gdk_windowing_init): Add more
      	pre-interned GdkAtoms and pre-registered clipboard formats. Sort
      	their declarations, definitions and assignments into a more
      	logical and consistent order.
      
      	* gdk/win32/gdkmain-win32.c (_gdk_win32_cf_to_string): Include the
      	CF_ prefix for the predefined clipboard format names. Put quotes
      	around registered format names to distinguish them.
      
      	* gdk/win32/gdkproperty-win32.c (gdk_property_change): Return
      	immediately with a warning if the property type is STRING, TEXT,
      	COMPOUND_TEXT or SAVE_TARGETS, as these are X11-specific that we
      	should never pretend to handle on Win32. Handle only UTF8_STRING
      	here, other formats with delayed rendering. Use \uc1 instead of
      	\uc0 when generating Rich Text Format for easier testability on
      	XP, where WordPad misinterprets \uc0 encoded characters. Add more
      	GDK_NOTE debugging output for Clipboard operations.
      
      	* gdk/win32/gdkselection-win32.c: Debugging printout improvements.
      	(gdk_selection_convert): Don't pretent to handle STRING, just
      	UTF8_STRING. Streamline error handling, don't unnecessarily have a
      	GError which then isn't used for anything anyway if it gets set.
      	(gdk_win32_selection_add_targets): Skip also STRING, TEXT,
      	COMPOUND_TEXT and SAVE_TARGETS in addition to UTF8_STRING.
      4d1b5589
  28. 20 Sep, 2005 2 commits
    • Tor Lillqvist's avatar
      Free return value from gdk_atom_name(). · 67a0d5df
      Tor Lillqvist authored
      2005-09-21  Tor Lillqvist  <tml@novell.com>
      
      	* gdk/win32/gdkselection-win32.c (gdk_selection_convert,
      	gdk_text_property_to_text_list_for_display,
      	gdk_text_property_to_utf8_list_for_display,
      	gdk_win32_selection_add_targets,
      	_gdk_win32_selection_convert_to_dib): Free return value from
      	gdk_atom_name().
      	(gdk_text_property_to_text_list_for_display): Drop GError variable
      	that isn't actually used after being set.
      67a0d5df
    • Tor Lillqvist's avatar
      Do return the correct owner for CLIPBOARD (i.e., the owner of the Windows · d46d791d
      Tor Lillqvist authored
      2005-09-20  Tor Lillqvist  <tml@novell.com>
      
      	* gdk/win32/gdkselection-win32.c
      	(gdk_selection_owner_get_for_display): Do return the correct owner
      	for CLIPBOARD (i.e., the owner of the Windows Clipboard, if it is
      	a window GDK knows about). The reason to return NULL seems to have
      	gone when in the fix for bug #163702 the artificial
      	GDK_SELECTION_CLEAR event generation was removed from
      	gdk_selection_send_notify_for_display(). Fixes bug #316552.
      d46d791d
  29. 11 Apr, 2005 1 commit
    • Ivan, Wong Yat Cheung's avatar
      Fix #300218: · 47b096e2
      Ivan, Wong Yat Cheung authored
      2005-04-11  Ivan, Wong Yat Cheung  <email@ivanwong.info>
      
      	Fix #300218:
      
      	* gdk/win32/gdkselection-win32.c (gdk_selection_convert): Fix
      	C99ism.
      
      	* gtk/updateiconcache.c: Guard inclusion of unistd.h and
      	utime.h.
      47b096e2
  30. 04 Apr, 2005 1 commit
    • Tor Lillqvist's avatar
      New debugging function, to log a clipboard format name symbolically. · 0b2ac32c
      Tor Lillqvist authored
      2005-04-04  Tor Lillqvist  <tml@novell.com>
      
      	* gdk/win32/gdkmain.c (_gdk_win32_cf_to_string): New debugging
      	function, to log a clipboard format name symbolically.
      	(_gdk_win32_data_to_string): Also new, to log random data bytes.
      
      	Implement delayed rendering on Win32, specifically for transfering
      	images through the clipboard from GTK+ apps to other
      	apps (#168173, implementation by Ivan Wong):
      
      	* gdk/win32/gdkevents-win32.c (gdk_event_translate):
      	Handle WM_RENDERFORMAT.
      
      	* gdk/win32/gdkprivate-win32.h
      	* gdk/win32/gdkglobals-win32.c: Add _format_atom_table,
      	_delayed_rendering_data and _image_bmp.
      
      	* gdk/win32/gdkmain-win32.c: Initialize _image_bmp.
      
      	* gdk/win32/gdkproperty-win32.c (gdk_property_change):
      	Accept formats other than GDK_TARGET_STRING or _utf8_string, and
      	assume they are handled through delayed rendering.
      
      	* gdk/win32/gdkselection-win32.c (gdk_selection_convert):
      	Return all available formats (including those registered by GTK+
      	apps) on request_targets.
      	(gdk_selection_property_get): We should append a zero byte like
      	X11 does.
      	(gdk_win32_selection_add_targets): New function, for
      	gtkselection's use. Win32 requires that the clipboard owner
      	registers all valid formats even if the owner wants delayed
      	rendering.
      	(_gdk_win32_selection_convert_to_dib): New function. Convert
      	images to DIB using gdk-pixbuf.
      
      	* gdk/win32/gdkwin32.h: Declare gdk_win32_selection_add_targets().
      
      	* gtk/gtkselection.c (gtk_selection_add_target,
      	gtk_selection_add_targets): Call gdk_win32_selection_add_targets()
      	to register target formats.
      
      	* gdk/gdk.symbols: Add gdk_win32_selection_add_targets().
      0b2ac32c
  31. 16 Mar, 2005 1 commit
    • Tor Lillqvist's avatar
      Print debugging output only if asked for, not always. · df9768cf
      Tor Lillqvist authored
      2005-03-16  Tor Lillqvist  <tml@novell.com>
      
      	* gdk/win32/gdkdisplay-win32.c (_win32_on_clipboard_change): Print
      	debugging output only if asked for, not always.
      
      	* gdk/win32/*.c: Use the %+d%+d format for coordinate pairs in
      	debugging printout instead of +%d+%d. Misc other additions and
      	cosmetic improvements to debugging printouts. Use API_CALL() and
      	GDI_CALL() macros in more places.
      
      	* gdk/win32/gdkwindow-win32.c (gdk_window_move, gdk_window_resize,
      	gdk_window_move_resize): To detect child windows, check whether
      	the real parent is not the desktop window, instead of relying on
      	the GDK window type being GDK_WINDOW_CHILD. Foreign GtkPlug
      	windows have a GDK window type GDK_WINDOW_FOREIGN, but are still
      	de facto child windows.
      df9768cf
  32. 02 Feb, 2005 1 commit
  33. 23 Jan, 2005 1 commit
    • Tor Lillqvist's avatar
      Fix for #163702, from Ivan Wong: · 736f4c87
      Tor Lillqvist authored
      2005-01-23  Tor Lillqvist  <tml@novell.com>
      
      	Fix for #163702, from Ivan Wong:
      
      	* gdk/win32/gdkprivate-win32.h
      	* gdk/win32/gdkglobals-win32.c: New flag _ignore_destroy_clipboard.
      
      	* gdk/win32/gdkevents-win32.c (gdk_event_translate): Handle
      	WM_DESTROYCLIPBOARD. Unless _ignore_destroy_clipboard, generate a
      	GDK_SELECTION_CLEAR event.
      
      	* gdk/win32/gdkselection-win32.c
      	(gdk_selection_owner_set_for_display): Set _ignore_destroy_clipboard
      	when emptying the clipboard ourselves.
      
      	(gdk_selection_send_notify_for_display): Remove the artifical
      	GDK_SELECTION_CLEAR event generation.
      736f4c87
  34. 07 Jan, 2005 1 commit