Commit Graph

279 Commits

Author SHA1 Message Date
Benjamin Otte
3494f87a10 API: Remove GdkNoExposeEvent
It's not used by anyone and not supported by any backend but X11.
2010-12-02 20:21:04 +01:00
William Jon McCann
323df2b280 Make gdk_event_apply_filters safe against changes in filter list
An event filter may add or remove filters itself.  This patch does
two things to address this case.  The first is to take a temporary
reference to the filter while it is being used.  The second is
to wait until after the filter function is run before determining
the next node in the list to process.  This guards against
changes to the next node.  It also does not run functions
that have been marked as removed.  Though I'm not sure if this
case can arise.

https://bugzilla.gnome.org/show_bug.cgi?id=635380
2010-11-22 13:16:24 -05:00
Tor Lillqvist
e346d26f70 Make it compile again for Windows 2010-10-07 01:28:47 +03:00
Tor Lillqvist
ceca2ff10c Adapt to the GDK_KEY changes 2010-09-09 14:35:20 +03:00
Tor Lillqvist
f42814168c Just use TrackMouseEvent directly
TrackMouseEvent is present in user32.dll in all Windows versions we
support. No need to look it up dynamically. No need to fallback to
_TrackMouseEvent from comctrl32.dll.
2010-09-03 00:30:56 +03:00
Benjamin Otte
300e6b84cd s/GdkRegion/cairo_region_t/ in all of gtk
https://bugzilla.gnome.org/show_bug.cgi?id=613284
2010-06-29 16:06:38 +02:00
Benjamin Otte
3e96cfe8fc Deprecate the GdkRegion API
Includes fixing all callers to use the cairo region API instead. This is
usually just replacing the function names, the only difference is
gdk_region_get_rectangles() being replaced by
cairo_region_num_rectangles() and cairo_region_get_rectangle() which
required a bit more work.

https://bugzilla.gnome.org/show_bug.cgi?id=613284
2010-06-29 16:06:38 +02:00
Tor Lillqvist
adf1bbe28a Generate correct grab broken event for WM_KILLFOCUS
WM_KILLFOCUS means that a keyboard grab (not a pointer grab), if any,
has been broken. I don't think this bug has matterd much as gtk
generates a grab-broken-event signal for both keybord and pointer
grabs being broken anyway.
2010-06-22 21:33:49 +03:00
Colin Walters
95bc0f5405 Use g_source_set_name for all custom GSources in GTK+
Naming the sources allows easier debugging with e.g. SystemTap
probes.

https://bugzilla.gnome.org/show_bug.cgi?id=620511
2010-06-03 21:49:22 -04:00
Matthias Clasen
bd4609b140 Merge the xi2-for-master branch 2010-05-25 18:38:44 -04:00
Javier Jardón
7894951cee Remove deprecated code from GdkEvent 2010-05-03 01:48:45 +02:00
Tor Lillqvist
eb21a7df29 Work on OLE2-based generic DND
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.
2009-12-16 13:10:21 +02:00
Tor Lillqvist
c1ddd8f9bc Make the gdk/win32 event debug printing function non-static
Make print_event() extern and rename it to _gdk_win32_print_event() so
it can be used from all gdk/win32 source files.
2009-12-16 13:10:19 +02:00
Tor Lillqvist
1bf9a2fa41 Remove unused functions and variables 2009-12-16 13:10:18 +02:00
Hans Breuer
c5c87a918f Some cursor work for csw(win32), more left to do 2009-07-26 19:14:06 +02:00
Hans Breuer
c99b4e775b Bug #588379 - testgtk::panes does not change the cursor on mouse over
That one was easy, just removing Alex's #ifdef TODO_CSW ;)

http://bugzilla.gnome.org/show_bug.cgi?id=588379
2009-07-13 09:45:03 +02:00
Hans Breuer
e2000ac366 Bug #588373 - Menus broken by client-side-windows
Resurrcetion and adaption of find_window_for_mouse_event(). The window
receiving the WM_MOUSEMOVE, WM_?BUTTONDOWN is not necessarily the one
interested in GDK_(ENTER|MOTION|LEAVE)_NOTIFY

http://bugzilla.gnome.org/show_bug.cgi?id=588373

Also added some more more TODO_CSW and disabled print_event(): it can not
cope with the new _gdk_windowing_got_event() eating/morphing events.
2009-07-13 09:45:02 +02:00
Alexander Larsson
b1df568239 Some win32 cleanups 2009-07-01 12:06:57 +02:00
Alexander Larsson
5341efd4d4 Make win32 backend build and minimally work 2009-07-01 10:28:06 +02:00
Cody Russell
1288ef1707 Grab changes 2009-04-02 10:16:30 +02:00
Cody Russell
f4331caf83 grabs 2009-04-02 10:16:30 +02:00
Cody Russell
49a0ec6e95 Updates 2009-04-02 10:16:30 +02:00
Cody Russell
3fdd1333b2 Misc stuff 2009-04-02 10:16:29 +02:00
Cody Russell
a93c6cd6e1 CSW Win32 work in progress - builds but does not work yet. 2009-04-02 10:16:29 +02:00
Tor Lillqvist
c3879d400c Bug 575700 - Crash when moving a GtkWindow
2009-03-17  Tor Lillqvist  <tml@novell.com>

	Bug 575700 - Crash when moving a GtkWindow

	* gdk/win32/gdkevents-win32.c (gdk_event_translate): Fix
	embarrassing crasher bug introduced on 2009-03-11. A variable was
	assigned a value only inside a GDK_NOTE but still used outside
	that.


svn path=/trunk/; revision=22568
2009-03-17 18:26:28 +00:00
Tor Lillqvist
93bb740db3 Bug 570896 - gdkevents-win32.c(2947) : error C4053: one void operand for
2009-03-11  Tor Lillqvist  <tml@iki.fi>

	Bug 570896 - gdkevents-win32.c(2947) : error C4053: one void
	operand for '?:'

	* gdk/win32/gdkevents-win32.c (gdk_event_translate): Fix
	compilation error with MSVC. While at it add clarifying comments
	and fix a typo in the debugging output.


svn path=/trunk/; revision=22515
2009-03-11 12:50:51 +00:00
Tor Lillqvist
703a18c25f Bug 574794 - Can not resize shaped windows on Windows
2009-03-11  Tor Lillqvist  <tml@iki.fi>

	Bug 574794 - Can not resize shaped windows on Windows

	* gdk/win32/gdkevents-win32.c (gdk_event_translate): On handling
	WM_WINDOWPOSCHANGED, don't do anything if the position and size
	hasn't changed. I am not exactly sure I understand why this helps
	this particular bug.


svn path=/trunk/; revision=22511
2009-03-11 12:04:22 +00:00
Tor Lillqvist
3f4c73d0d5 Bug 559408 - Transparency lost when images are copied between GTK+ and the
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
2009-01-30 01:16:47 +00:00
Tor Lillqvist
74aeac9e66 Bug 557212 - Problem with which window gains focus and is visible
2008-11-04  Tor Lillqvist  <tml@novell.com>

	Bug 557212 - Problem with which window gains focus and is visible

	* gdk/win32/gdkevents-win32.c (ensure_stacking_on_activate_app):
	Only do the restacking for the active window of the
	application. Seems to fix the problem.

	(gdk_event_translate): Only call ensure_stacking_on_activate_app()
	when the application is being activated, not deactivated.


svn path=/trunk/; revision=21756
2008-11-03 22:38:29 +00:00
Tor Lillqvist
c2129d07ca Bug 558278 - Crash when calling a callback set by
2008-11-01  Tor Lillqvist  <tml@novell.com>

	Bug 558278 - Crash when calling a callback set by
	gdk_add_client_message_filter()

	* gdk/win32/gdkevents-win32.c (apply_event_filters): Rename from
	apply_filters() so that it is clear that this function is for
	GdkEventFilters only.

	(print_event): Print more information for GDK_CLIENT_EVENT events.

	(gdk_event_translate): When handling client filters, don't use
	apply_event_filters(). Use similar code as in the X11 backend,
	although not exactly, as the parameter list and return value
	semantics of gdk_event_translate() is different.


svn path=/trunk/; revision=21748
2008-11-01 11:55:16 +00:00
Tor Lillqvist
a7dd74740a On WM_WINDOWPOSCHANGING, don't dereference windowpos in the debugging
2008-10-18  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkevents-win32.c (gdk_event_translate): On
	WM_WINDOWPOSCHANGING, don't dereference windowpos in the debugging
	output without setting it first.

2008-10-18  Tor Lillqvist  <tml@novell.com>

	Bug 556578 - GIMP windows stay on top of other windows

	* gdk/win32/gdkevents-win32.c (ensure_stacking_on_unminimize)
	(ensure_stacking_on_window_pos_changing)
	(ensure_stacking_on_activate_app): Ignore unmapped windows in the
	loops where we look for the lowest "transient-type" window.

	(gdk_event_translate): Don't call
	ensure_stacking_on_window_pos_changing() or
	ensure_stacking_on_activate_app() for unmapped windows.


svn path=/trunk/; revision=21676
2008-10-17 22:56:33 +00:00
Tor Lillqvist
55d7d50e13 Bug 132501 - Make utility window translate to tool window in win32
2008-10-04  Tor Lillqvist  <tml@novell.com>

	Bug 132501 - Make utility window translate to tool window in win32

	Implement the utility window type hint. Such windows are kept on
	top of other windows. Makes GIMP's toolbox and dock windows behave
	more like in GNOME under metacity. Apply the same logic also to
	windows marked with the dialog window type hint, and windows that
	are transient for some other window. I'll call such windows
	"transient-type" below.

	* gdk/win32/gdkevents-win32.c (doesnt_want_key): Drop unused
	variables.

	(ensure_stacking_on_unminimize)
	(ensure_stacking_on_window_pos_changing)
	(ensure_stacking_on_activate_app): New functions to implement the
	desired stacking order. Make sure that a window that is not
	transient-type stays below any transient-type windows of the
	application. When activating a non-transient-type window make sure
	it rises as high as possible.

	(gdk_event_translate): Call above functions on
	WM_WINDOWPOSCHANGING, WM_ACTIVATEAPP and on WM_SIZE when
	unminimizing. Improve debugging printout.

	* gdk/win32/gdkwindow-win32.c (get_effective_window_decorations):
	Handle utility windows like toolbar windows.

	(gdk_window_new_internal) (update_style_bits): Give utility
	windows the WS_EX_TOOLWINDOW extended style.

	(gdk_window_set_title): If debugging "misc" or "events", make the
	handle of top-level windows show up in their title bars. Very
	useful when looking at debugging output.

	(gdk_window_set_keep_above) (gdk_window_set_keep_below)
	(gdk_window_set_modal_hint) (gdk_window_set_skip_taskbar_hint)
	(gdk_window_set_skip_pager_hint): Add and improve debugging
	printout.

	(gdk_window_set_type_hint): Print hint symbolically in GDK_NOTE().

2008-10-04  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkmain-win32.c (_gdk_win32_window_exstyle_to_string)
	(_gdk_win32_window_pos_bits_to_string): New debugging printout
	functions. Decode the WS_EX_* and SWP_* bits.

	* gdk/win32/gdkprivate-win32.h: Declare them. Define
	GDK_DEBUG_MISC_OR_EVENTS for use in GDK_NOTE() to match either
	"misc" or "events".


svn path=/trunk/; revision=21587
2008-10-05 00:00:10 +00:00
Cody Russell
1c146ec11f Check if the window's state has GDK_WINDOW_STATE_MAXIMIZED set before
2008-08-27  Cody Russell  <bratsche@gnome.org>

        * gdk/win32/gdkevents-win32.c:
        * gdk/win32/gdkwindow-win32.c (show_window_recurse): Check if
        the window's state has GDK_WINDOW_STATE_MAXIMIZED set before
        calling ShowWindow (), and show using SW_SHOWMAXIMIZED or     
        SW_RESTORE accordingly.  This fixes an issue where maximized 
        windows that are iconified do not restore back to maximized 
        when you click the taskbar. (#528975)


svn path=/trunk/; revision=21218
2008-08-28 02:42:23 +00:00
Cody Russell
96aa256594 Remove the checks to see if the window is modally blocked. This doesn't
2008-08-21  Cody Russell  <bratsche@gnome.org>

        * gdk/win32/gdkevents-win32.c (doesnt_want_key): Remove the checks
        to see if the window is modally blocked.  This doesn't get us anything,
        and it confuses the search window in GtkTreeView (and potentially other
        utility windows in other apps).  (#520165)


svn path=/trunk/; revision=21180
2008-08-22 00:30:06 +00:00
Tor Lillqvist
d6ab77ea70 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/win32/gdkcursor-win32.c
	* gdk/win32/xcursors.h: Change some gchar* to guchar* and vice
	versa to avoid gcc 4.4 signedness warnings.

	* gdk/win32/gdkevents-win32.c: Add some guchar and char pointer
	casts to get rid of gcc 4.4 signedness warnings. Print GdkAtom
	values in debugging output using the %p format.
	
	* gdk/win32/gdkkeys-win32.c
	* gdk/win32/gdkfont-win32.c
	* gdk/win32/gdkmain-win32.c: Add some casts to avoid gcc warnings.
 
	* gdk/win32/gdkwindow-win32.c: Use SetWindowLongPtr() instead of
	SetWindowLong().

	* gdk/win32/gdkwin32id.c (gdk_handle_hash): Use all 64 bits of a
	HANDLE on Win64.


svn path=/trunk/; revision=20994
2008-08-04 23:21:36 +00:00
Cody Russell
c8061385a9 Bug 544510 – SetTimer callback signatures has the wrong type
2008-07-24  Cody Russell  <bratsche@gnome.org>

        Bug 544510 – SetTimer callback signatures has the wrong type

        * gdk/win32/gdkevents-win32.c: Fix modal_timer_proc() and
        sync_timer_proc() to use UINT_PTR for the 'id' parameter
        instead of 'id'.  Patch by Richard Hult.


svn path=/trunk/; revision=20903
2008-07-24 12:55:53 +00:00
Cody Russell
c8fef535b2 Bug 153567 – Repaint glitches in widgets
2008-07-21  Cody Russell  <bratsche@gnome.org>

        Bug 153567 – Repaint glitches in widgets

        * gdk/win32/gdkevents-win32.c: Set a sync timer when
        we receive WM_SYNCPAINT, and RedrawWindow() once
        the timer expires.


svn path=/trunk/; revision=20881
2008-07-21 12:46:41 +00:00
Cody Russell
e625b41a1d Bug 541162 – [Win32] Update for the new GdkWindowImpl stuff
2008-07-02  Cody Russell  <bratsche@gnome.org>

        Bug 541162 – [Win32] Update for the new GdkWindowImpl stuff

        * gdk/win32/gdkprivate-win32.h:
        * gdk/win32/gdkgeometry-win32.c:
        * gdk/win32/gdkevents-win32.c:
        * gdk/win32/gdkwindow-win32.c: Update Win32 backend according to
        the newly refactored GdkWindow code.


svn path=/trunk/; revision=20729
2008-07-02 06:06:29 +00:00
Cody Russell
0d0f9a7fc1 Bug 539164 – Windows' System Menu blocks main loop
2008-07-01  Cody Russell  <bratsche@gnome.org>

        Bug 539164 – Windows' System Menu blocks main loop

        * gdk/win32/gdkevents-win32.c:	Use a modal timer proc in between
	receiving WM_ENTERMENULOOP and	WM_EXITMENULOOP	and pump	the
	GLib mainloop from there.


svn path=/trunk/; revision=20726
2008-07-01 23:13:26 +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
Tor Lillqvist
710c9619b9 Bug 533108 - leak of GDI region in function 'handle_wm_paint'
2008-05-30  Tor Lillqvist  <tml@novell.com>

	Bug 533108 - leak of GDI region in function 'handle_wm_paint'

	* gdk/win32/gdkevents-win32.c (handle_wm_paint): Patch by Daniel
	Atallah.


svn path=/trunk/; revision=20250
2008-05-30 07:17:40 +00:00
Michael Natterer
f3cd3f7cf5 gdk/gdkinternals.h gdk/gdkevents.c gdk/directfb/gdkevents-directfb.c
2008-05-07  Michael Natterer  <mitch@imendio.com>

	* gdk/gdkinternals.h
	* gdk/gdkevents.c
	* gdk/directfb/gdkevents-directfb.c
	* gdk/quartz/gdkevents-quartz.c
	* gdk/win32/gdkevents-win32.c
	* gdk/x11/gdkevents-x11.c (_gdk_windowing_event_data_copy):
	order parameters src,dest and make src const.


svn path=/trunk/; revision=20079
2008-05-06 22:35:13 +00:00
Richard Hult
4ee2d1b6ba Add private backend data to events, and handle it when copying/freeing
2008-05-06  Richard Hult  <richard@imendio.com>

	* gdk/gdkevents.c: (gdk_event_copy), (gdk_event_free):
	* gdk/gdkinternals.h: Add private backend data to events, and
	handle it when copying/freeing events. Currently only needed in
	the quartz backend.

	* gdk/directfb/gdkevents-directfb.c:
	* gdk/quartz/gdkevents-quartz.c:
	* gdk/win32/gdkevents-win32.c:
	* gdk/x11/gdkevents-x11.c: (_gdk_windowing_event_data_copy)
	(_gdk_windowing_event_data_free): Add stubs for X11, win32 and
	directfb. Implement for quartz. Part of fixing bug #473822.

svn path=/trunk/; revision=20078
2008-05-06 21:00:06 +00:00
Cody Russell
ca2987a0f9 Check window state for GDK_WINDOW_STATE_ICONIFIED before doing ShowWindow
2008-03-23  Cody Russell  <bratsche@gnome.org>

        * gdk/win32/gdkevents-win32.c (show_window_recurse):
        Check window state for GDK_WINDOW_STATE_ICONIFIED before doing
        ShowWindow (SW_RESTORE).  This fixes a problem where tearing off
        menus from a maximized window would force the window to restore
        its size. (#518846)


svn path=/trunk/; revision=19926
2008-03-23 15:37:40 +00:00
Tor Lillqvist
ea87c926e2 Drop the support for the MSH_MOUSEWHEEL message that MSDN says is used
2008-03-14  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkevents-win32.c: Drop the support for the
	MSH_MOUSEWHEEL message that MSDN says is used only on NT 3.51 and
	Win95. Thanks to mitch for noticing this obsolete code.


svn path=/trunk/; revision=19874
2008-03-14 16:11:50 +00:00
Cody Russell
e97c716a21 gdk/win32/gdkevents-win32.c Fixed two declarations in the middle of a
2008-02-07  Cody Russell  <bratsche@gnome.org>

        * gdk/win32/gdkevents-win32.c
        * gdk/win32/gdkwindow-win32.c: Fixed two declarations in the middle
        of a block that were causing compile problems on old
        compilers. (#515053, reported by Kazuki IWAMOTO)


svn path=/trunk/; revision=19493
2008-02-07 19:25:07 +00:00
Cody Russell
6e03989a4c Also check that the window is not mapped.
svn path=/trunk/; revision=19485
2008-02-06 17:01:47 +00:00
Cody Russell
84dd6a99b8 Check if the window is a temp window, otherwise things get wonky when you
2008-02-06  Cody Russell  <bratsche@gnome.org>

        * gdk/win32/gdkevents-win32.c: Check if the window is a temp window,
        otherwise things get wonky when you click on a menu.  This fixes
        a regression caused in #505928.  Thanks to Tor for spotting this
        one!  (#514789)


svn path=/trunk/; revision=19482
2008-02-06 16:32:41 +00:00
Cody Russell
db58254c5c gdk/win32/gdkprivate-win32.h gdk/win32/gdkevents-win32.c
2008-02-05  Cody Russell  <bratsche@gnome.org>

        * gdk/win32/gdkprivate-win32.h
        * gdk/win32/gdkevents-win32.c
        * gdk/win32/gdkwindow-win32.c
        * gdk/win32/gdkwindow-win32.h
        * gdk/win32/gdkwin32.h:
        Modal window rework.  (#455627 and #511111)


svn path=/trunk/; revision=19463
2008-02-05 16:47:24 +00:00
Cody Russell
857fe308f5 Refactored some of the window hiding/showing code from WM_ACTIVATE to
2008-01-31  Cody Russell  <bratsche@gnome.org>

        * gdk/win32/gdkevents-win32.c:
        Refactored some of the window hiding/showing code from
        WM_ACTIVATE to WM_SIZE and WM_SYSCOMMAND.  Having this
        under WM_ACTIVATE was causing the application to go into
        a weird state when the user right-clicked on the taskbar
        entry of a window that was minimized.  (#505928)


svn path=/trunk/; revision=19451
2008-01-31 22:40:37 +00:00
Cody Russell
045db5be38 Check that the window is mapped before setting SW_RESTORE or SW_MINIMIZE.
2007-12-23  Cody Russell  <bratsche@gnome.org>

        * gdk/win32/gdkevents-win32.c (show_window_recurse): Check that
        the window is mapped before setting SW_RESTORE or SW_MINIMIZE.
        Fixes a regression caused by #164537 patch where transient
        windows that are hidden get shown (incorrectly) when their
        parents are minimized. (#504984)


svn path=/trunk/; revision=19231
2007-12-23 21:14:09 +00:00
Tor Lillqvist
9466ea35a8 Add a block around the WM_ACTIVATE case to avoid declaring variables in
2007-10-19  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkevents-win32.c (gdk_event_translate): Add a block
	around the WM_ACTIVATE case to avoid declaring variables in the
	middle of a block. (#488017)


svn path=/trunk/; revision=18932
2007-10-19 12:36:04 +00:00
Cody Russell
21d3d60f48 gdk/win32/gdkevents-win32.c Force non-modal transient dialogs to iconify
2007-10-17  Cody Russell  <cody@jhu.edu>

        * gdk/win32/gdkevents-win32.c
        * gdk/win32/gdkwindow-win32.[ch]: Force non-modal transient dialogs
        to iconify with their parents on Win32.  Maintain a list of transient
        children, and whenever a window is hidden or restored we now do the
        same thing to all connected transient windows above and below the
        current window in the chain.  See comment under WM_ACTIVATE for the
        reasons why.  (#164537, #371036, #405178)


svn path=/trunk/; revision=18929
2007-10-18 00:31:22 +00:00
Cody Russell
e992008541 gdk/win32/gdkevents-win32.c Fix transient windows on Win32 so that when a
2007-07-12  Cody Russell  <bratsche@gnome.org>

	* gdk/win32/gdkevents-win32.c
	* gdk/win32/gdkwindow-win32.[ch]: Fix transient windows on Win32 
	so that when a transient child window is closed (particularly when 
	there are 3 or more levels of transient windows), the correct window
	receives focus rather than a seemingly random window. (#112404) 


svn path=/trunk/; revision=18461
2007-07-12 23:38:30 +00:00
Tor Lillqvist
1d5ef907b2 Revert my attempted overly simple fix for #445284, as it causes a
2007-06-25  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkevents-win32.c (gdk_pointer_grab): Revert my
	attempted overly simple fix for #445284, as it causes a
	regression. (For instance, in GIMP the tool cursor gets used also
	for the right-click menu in image windows.) A more complex fix is
	needed to more completely emulate X11 behaviour.


svn path=/trunk/; revision=18225
2007-06-25 06:38:58 +00:00
Cody Russell
83d5a36c9f Don't revert the mouse cursor to the built-in one when the user holds the
2007-06-10  Cody Russell  <bratsche@gnome.org>

        * gdk/win32/gdkevents-win32.c (gdk_pointer_grab):
        Don't revert the mouse cursor to the built-in one when
        the user holds the mouse button down. (#445284, Tor Lillqvist)


svn path=/trunk/; revision=18093
2007-06-10 16:13:09 +00:00
Tor Lillqvist
d022f4c32d Subtract the multi-monitor offset from x and y before setting up the
2007-05-30  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkevents-win32.c (gdk_pointer_grab): Subtract the
	multi-monitor offset from x and y before setting up the rectangle
	for ClipCursor(). Fixes #442326.


svn path=/trunk/; revision=17988
2007-05-30 15:44:28 +00:00
Cody Russell
50af49319a Fix context iterations for handle_configure_event()
svn path=/trunk/; revision=17834
2007-05-13 18:44:27 +00:00
Cody Russell
ea7cc8d95e Fix Win32 resize events and flickering
svn path=/trunk/; revision=17299
2007-02-15 18:28:55 +00:00
Tor Lillqvist
f6b4585c98 Build Wintab support always on Windows. Don't require the Wintab SDK.
2007-01-19  Tor Lillqvist  <tml@novell.com>

	Build Wintab support always on Windows. Don't require the Wintab
	SDK.

	* configure.in: Drop the --with-wintab option. Drop the
	HAVE_WINTAB feature test macro and Automake variable.

	* acconfig.h
	* config.h.win32.in: Drop HAVE_WINTAB.

	* gdk/win32/gdkevents-win32.c 
	* gdk/win32/gdkinput.c 
	* gdk/win32/gdkinput-win32.h 	
	* gdk/win32/gdkinput-win32.c
	* gdk/win32/gdkmain-win32.c: Make HAVE_WINTAB ifdef blocks
	unconditional.

	* gdk/win32/gdkinput-win32.c (_gdk_input_wintab_init_check): Try
	to load wintab32.dll dynamically here. If it is found look up the
	handful Wintab functions we use.
	(rest of file): Use these function pointers instead of calling the
	functions from wntab32x.lib. The code in wntab32x.lib did the same
	thing anyway: tried to load wintab32.dll, and looked up the
	addresses of the actual functions from it.

	* gdk/Makefile.am
	* gdk/win32/Makefile.am: Drop the libwntab32x hacks.

	* gdk/win32/wintab.h
	* gdk/win32/pktdef.h: New files. Copied from the Wintab
	SDK. Copyright blurb says: "The text and information contained in
	this file may be freely used, copied, or distributed without
	compensation or licensing restrictions."

	* README.win32: Update a bit. Remove the text about the Wintab
	SDK.


svn path=/trunk/; revision=17186
2007-01-19 01:55:52 +00:00
Tor Lillqvist
25b98a5935 gdk/win32/gdkevents-win32.c Use wide-char API for message and window
2006-09-04  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkevents-win32.c
	* gdk/win32/gdkwindow-win32.c: Use wide-char API for message and
	window handling (PeekMessage, PostMessage, SendMessage,
	DispatchMessage, DefWindowProc, RegisterClassEx,
	CreateWindowEx). (#321597)
2006-09-03 22:50:00 +00:00
Tor Lillqvist
019fece724 Remove support for Windows 9x/ME. GTK+ hasn't worked on Win9x since 2.6 or
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.

	* configure.in
	* acconfig.h
	* gdk/Makefile.am
	* gdk/win32/Makefile.am
	* gdk/win32/libie55uid.la
	* gdk/win32/gdkevents-win32.c: Remove the --with-ie55 configure
	switch and associated stuff. Active IMM and the <dimm.h> header
	was used for IM support on NT4 and Win9x. Win2k and later have IM
	support built-in.

	* gdk/win32/gdkevents-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.
2006-08-29 22:55:31 +00:00
Tor Lillqvist
f93e5455e9 [WM_WINDOWPOSCHANGED] Replace identical code as in
2006-06-08  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkevents-win32.c (gdk_event_translate):
	[WM_WINDOWPOSCHANGED] Replace identical code as in
	handle_configure_event() with call to that function.
	[WM_SIZING] Fix implementation of aspect ratio hints. (#344244)
	The hints are for the geometry of the client area, not of the
	window including decorations. Improve resizing behaviouor in the
	presence of aspect hints, more in line with typical X window
	managers.
2006-06-08 15:00:25 +00:00
Tor Lillqvist
6a652781ac Look at both GDK_SCROLL_MASK and GDK_BUTTON_PRESS_MASK. (#139628)
2006-05-09  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkevents-win32.c (doesnt_want_scroll): Look at both
	GDK_SCROLL_MASK and GDK_BUTTON_PRESS_MASK. (#139628)
2006-05-09 15:54:22 +00:00
Alexander Larsson
27f746fbd0 Merge the gtk-printing branch. For more detailed ChangeLog entries, see
2006-04-21  Alexander Larsson  <alexl@redhat.com>

        Merge the gtk-printing branch.
	For more detailed ChangeLog entries, see the branch.

	* .cvsignore:
	* Makefile.am:
	* configure.in:
	* docs/tools/widgets.c:
	* gtk+-unix-print-2.0.pc.in:
	* gtk/Makefile.am:
	* gtk/gen-paper-names.c:
	* gtk/gtk.h:
	* gtk/gtk.symbols:
	* gtk/gtkenums.h:
	* gtk/gtkiconfactory.c:
	* gtk/gtkmarshalers.list:
	* gtk/gtkpagesetup.[ch]:
	* gtk/gtkpagesetupunixdialog.[ch]:
	* gtk/gtkpapersize.[ch]:
	* gtk/gtkprint-win32.[ch]:
	* gtk/gtkprintbackend.[ch]:
	* gtk/gtkprintcontext.[ch]:
	* gtk/gtkprinter-private.h:
	* gtk/gtkprinter.[ch]:
	* gtk/gtkprinteroption.[ch]:
	* gtk/gtkprinteroptionset.[ch]:
	* gtk/gtkprinteroptionwidget.[ch]:
	* gtk/gtkprintjob.[ch]:
	* gtk/gtkprintoperation-private.h:
	* gtk/gtkprintoperation-unix.c:
	* gtk/gtkprintoperation-win32.c:
	* gtk/gtkprintoperation.[ch]:
	* gtk/gtkprintsettings.[ch]:
	* gtk/gtkprintunixdialog.[ch]:
	* gtk/paper_names.c:
	* gtk/paper_names_offsets.c:
	Platform independent printing API and implementations
	for unix and windows.

	* gtk/gtkstock.h:
	* gtk/stock-icons/24/gtk-orientation-landscape.png:
	* gtk/stock-icons/24/gtk-orientation-portrait.png:
	* gtk/stock-icons/24/gtk-orientation-reverse-landscape.png:
	Add stock icons for page orientation.

	* modules/Makefile.am:
	* modules/printbackends/Makefile.am:
	* modules/printbackends/cups/Makefile.am:
	* modules/printbackends/cups/gtkcupsutils.[ch]:
	* modules/printbackends/cups/gtkprintbackendcups.[ch]:
	* modules/printbackends/cups/gtkprintercups.[ch]:

	Cups printing backend for unix.

	* modules/printbackends/lpr/Makefile.am:
	* modules/printbackends/lpr/gtkprintbackendlpr.[ch]:
	lpr printing backend for unix.

	* modules/printbackends/pdf/Makefile.am:
	* modules/printbackends/pdf/gtkprintbackendpdf.[ch]:
	print-to-pdf printing backend for unix.

	* tests/.cvsignore:
	* tests/Makefile.am:
	* tests/print-editor.c:
	Test application for printing.

	* gdk/gdk.symbols:
	* gdk/win32/gdkevents-win32.c:
	* gdk/win32/gdkwin32.h:
	Add gdk_win32_set_modal_dialog_libgtk_only so that we can pump the
	mainloop while displaying a win32 common dialog.

	* gdk/directfb/Makefile.am:
	Whitespace cleanup.
2006-04-21 15:09:32 +00:00
Tor Lillqvist
a7e8b3521c If we don't know where we went, and have generated a leave event, set
2006-02-09  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkevents-win32.c (gdk_event_translate)
	<WM_MOUSELEAVE>: If we don't know where we went, and have
	generated a leave event, set current_window to the root
	window. This assures we will generate proper enter and leave
	events for popup windows. (#325521)
2006-02-09 05:49:55 +00:00
John Ehresman
e847ace84b gdk/win32/gdkevents-win32.c (gdk_event_translate) <WM_MOUSEACTIVATE> Call
2006-02-08  John Ehresman  <jpe@wingware.com>

	* gdk/win32/gdkevents-win32.c (gdk_event_translate)
	<WM_MOUSEACTIVATE>
	* gdk/win32/gdkwindow-win32.c (show_window_internal)
	(gdk_window_raise): Call SetWindowPos() instead of
	SetForegroundWindow() or BringWindowToTop() if the window
	shouldn't accept focus. (#327375)
2006-02-09 03:20:56 +00:00
Tor Lillqvist
746a5c36a5 Consistenly use assign_object() when assigning GdkWindow pointers so that
2006-02-08  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkevents-win32.c (gdk_pointer_grab)
	(gdk_display_pointer_ungrab, gdk_keyboard_grab)
	(gdk_display_keyboard_ungrab): Consistenly use assign_object()
	when assigning GdkWindow pointers so that the ref counting doesn't
	get off whack.

	(handle_stuff_while_moving_or_resizing): Don't use deprecated API.

	(gdk_event_translate) <WM_MOUSEMOVE>: When the pointer is grabbed
	with owner_events FALSE, generate enter and leave events only for
	the grab window. (#321054)
2006-02-08 17:32:50 +00:00
Tor Lillqvist
33cb3f8f57 Revert stuff that was accidentally committed. 2006-01-02 00:48:39 +00:00
Tor Lillqvist
53e2c08380 Get the invalidated region from ScrollWindowEx() instead of an incorrect
2006-01-02  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkgeometry-win32.c (gdk_window_scroll): Get the
	invalidated region from ScrollWindowEx() instead of an incorrect
	attempt to calculate it ourselves. Fix by John Ehresman. (#323666)

	* gdkevents-win32.c: Make _gdk_win32_hrgn_to_region() non-static.

	* gdkprivate-win32.h: Declare it.
2006-01-02 00:45:39 +00:00
Tor Lillqvist
d297ff329f Don't treat Alt-Enter specially. It does not have any special meaning and
2005-10-13  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkevents-win32.c (gdk_event_translate): Don't treat
	Alt-Enter specially. It does not have any special meaning and
	should be passed on to the application. (#318378, Tim Evans)
2005-10-13 07:21:00 +00:00
Tor Lillqvist
b2595c847c Keep track of cursor position also in root window coordinates. Prune out
2005-09-02  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkevents-win32.c (gdk_event_translate): Keep track of
	cursor position also in root window coordinates. Prune out
	superfluous WM_MOUSEMOVE messages even earlier, based on root window
	coordinates. Windows sends WM_MOUSEMOVE messages after a new
	window has ben mapped below the cursor even if the mouse doesn't
	move. We used to generate GDK_MOTION_NOTIFY in these cases. This
	confused at least gtk_menu_motion_notify(). (#314995)

	* gtk/gtkintl.h: No need to include config.h here. It caused
	warnings about GTK_LOCALEDIR being redefined on Win32 when
	compiling files where gtkintl.h is included after gtkprivate.h
	(which #undefines and re-#defines GTK_LOCALEDIR on Win32).

	* gtk/gtkplug.c: Include config.h.
2005-09-02 01:54:45 +00:00
Tor Lillqvist
375cb32bc1 Cosmetics. 2005-07-29 00:35:21 +00:00
Tor Lillqvist
bdc7c892ca Remove ifdeffed out code relating to the gdk-ping message. Use the global
2005-07-29  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkevents-win32.c: Remove ifdeffed out code relating
	to the gdk-ping message. Use the global _gdk_display instead of
	calling gdk_display_get_default() which would return _gdk_display
	anyway.

	(append_event, apply_filters, gdk_event_translate): Drop any
	GdkDisplay parameter as we only have one display anyway. Use
	_gdk_display where needed.

	(gdk_event_apply_filters): Delete, move the code into its only
	caller, apply_filters().

	(generate_button_event): Factor out code from two places in
	gdk_event_translate().

	(gdk_event_translate): Call generate_button_event() in place of
	inline code.
2005-07-29 00:23:03 +00:00
Tor Lillqvist
8ac2c72f10 New static function to generate and append the GDK_GRAB_BROKEN events.
2005-07-29  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkevents-win32.c (generate_grab_broken_event): New
	static function to generate and append the GDK_GRAB_BROKEN events.

	(gdk_pointer_grab, gdk_keyboard_grab): Generate grab broken events
	when overriding a grab inside the application, like in the X11
	backend. Final bits of the fix for #107320, hopefully.

	(print_event): Handle also GDK_SETTING, GDK_OWNER_CHANGE and
	GDK_GRAB_BROKEN events.

	(gdk_event_translate): Call generate_grab_broken_event() in place
	of inline code.
2005-07-28 23:21:57 +00:00
Matthias Clasen
b2343762b1 Ignore GrabBroken events which are caused by overgrabbing inside the
2005-06-27  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkmenushell.c (gtk_menu_shell_grab_broken): Ignore
	GrabBroken events which are caused by overgrabbing inside
	the application; menus rely on these for their operation.

	* gdk/gdkevents.h (struct _GdkEventGrabBroken): Add a
	grab_window field.

	* gdk/win32/gdkevents-win32.c (gdk_event_translate): Set
	grab_window to NULL when generating GrabBroken events for
	WM_KILLFOCUS messages.

	* gdk/x11/gdkmain-x11.c (_gdk_xgrab_check_unmap)
	(_gdk_xgrab_check_destroy): Set grab_window to NULL when
	generating GrabBroken events when the grab window becomes
	unviewable or is destroyed.

	* gdk/x11/gdkmain-x11.c (gdk_pointer_grab, gdk_keyboard_grab):
	Generate GrabBroken events when overriding a grab inside
	the application. In this case, set grab_window to the new
	grab_window.
2005-06-27 21:06:33 +00:00
Matthias Clasen
9b356ea0d8 Add a GrabBroken event to GDK, and a grab-broken-event signal to
2005-06-25  Matthias Clasen  <mclasen@redhat.com>

	Add a GrabBroken event to GDK, and a grab-broken-event
	signal to GtkWidget.  (#107320, Simon Cooke, initial patch
	by John Ehresman)

	* gdk/gdkevents.h: Add a GDK_GRAB_BROKEN event type,
	define a GdkEventGrabBroken event struct.

	* gdk/win32/gdkevents-win32.c (gdk_event_translate):
	Generate GrabBroken events in response to WM_KILLFOCUS.

	* gdk/x11/gdkmain-x11.c: Generate GrabBroken events
	when a grab is broken by the window becoming unviewable,
	or by another grab from the same client.

	* gtk/gtkwidget.h (GtkWidgetClass): Add grab_broken_event.

	* gtk/gtkwidget.c (gtk_widget_event_internal): Translate
	GrabBroken events into grab_broken_event signals.

	* gtk/gtkmain.c (gtk_main_do_event): Propagate GrabBroken
	events.

	* gtk/gtkmenushell.c (gtk_menu_shell_grab_broken): Deactivate
	the menu when the grab is broken.

	* gtk/gtkcolorsel.c (gtk_color_selection_grab_broken): Stop
	the color picker if the grab is broken.

	* gtk/gtkpaned.c (gtk_paned_grab_broken): Stop the drag if
	the grab is broken.
2005-06-25 07:10:40 +00:00
Tor Lillqvist
ba7ee2270a gdk/win32/gdkevents-win32.c gdk/win32/gdkkeys-win32.c Check the
2005-05-18  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkevents-win32.c
	* gdk/win32/gdkkeys-win32.c
	* gdk/win32/gdkprivate-win32.h: Check the KF_EXTENDED bit in
	lParam of WM_KEY* messages to distinguish between left and right
	Control and Alt keys. Unfortunately, the right Shift key doesnt
	set KF_EXTENDED, so to distinguish between left and right Shift
	keys, check the scan code. (#304584)
2005-05-18 14:53:00 +00:00
Tor Lillqvist
0b2ac32cf5 New debugging function, to log a clipboard format name symbolically.
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().
2005-04-04 00:12:26 +00:00
Tor Lillqvist
681afb7b6a Fix event filter handling. If an event filter (global, client message
2005-03-30  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkevents-win32.c (gdk_event_translate): Fix event
	filter handling. If an event filter (global, client message
	filter, of window-specific) returns GDK_FILTER_CONTINUE,
	continue as if nothing happened. If it returns
	GDK_FILTER_REMOVE or GDK_FILTER_TRANSLATE, return TRUE from
	gdk_event_translate() which means that DefWindowProc() will
	not be called.
	(gdk_event_translate): Fix client message handling. Append a
	GDK_CLIENT_EVENT unless there is a filter that matches and returns
	something other than GDK_FILTER_CONTINUE. (#135552)
2005-03-30 08:25:45 +00:00
Tor Lillqvist
3618011a5a The state field should represent the state before the event, like on X11.
2005-03-30  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkevents-win32.c (build_pointer_event_state): The
	state field should represent the state before the event, like on
	X11. (#169753)
2005-03-30 08:07:45 +00:00
Tor Lillqvist
e4515f4dba On WM_MOUSEMOVE, don't check if this process owns the active window. This
2005-03-18  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkevents-win32.c (gdk_event_translate): On
	WM_MOUSEMOVE, don't check if this process owns the active
	window. This makes cross-application widget embedding work better.
	On WM_MOVE, don't bother checking for window visibility.

	* gdk/win32/gdkim-win32.c: Remove bogus empty doc comment. Remove
	unused variables. Add some casts to silence gcc.
2005-03-18 10:21:51 +00:00
Tor Lillqvist
34bfd71279 gdk/win32/gdkprivate-win32.h Drop global variable _gdk_root_window, just
2005-03-16  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/*.c: Drop global variable _gdk_root_window, just call
	GetDesktopWindow(). Rename the GdkWindow* _gdk_parent_root to
	_gdk_root.

	* gdk/win32/gdkwindow-win32.h (GdkWindowImplWin32): Add
	toplevel_window_type field.

	* gdk/win32/gdkwindow-win32.c: As there is only one root
	window in GDK on Win32, we can compare directly to _gdk_root
	instead of checking the window type.
	(gdk_window_reparent): When reparenting a child of the desktop
	clear out the window decorations. Correspondingly, when
	reparenting to the desktop, add decorations. As in the X11
	backend, save the window type of a toplevel window when
	reparenting, in case it is reparented back to toplevel.
2005-03-16 02:21:14 +00:00
Tor Lillqvist
df9768cf3a Print debugging output only if asked for, not always.
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.
2005-03-16 01:38:57 +00:00
Tor Lillqvist
7c12edeb93 New debugging function. As GetKeyNameText() returns a localized key name
2005-03-15  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkmain-win32.c (_gdk_win32_key_to_string): New
	debugging function. As GetKeyNameText() returns a localized key
	name we need to convert it to UTF-8.

	* gdk/win32/gdkprivate-win32.h: Declare it.

	* gdk/win32/gdkevents-win32.c: Use it.

	* gdk/win32/gdkwindow-win32.c (gdk_window_new_internal): Fix
	handling of children of foreign windows. They should be child
	windows from Windows's perspective, even if they are toplevel GDK
	windows.
2005-03-15 02:07:08 +00:00
Robert Ögren
81c1b1dade Implement better handling of Wintab tablet context overlap on Win32.
2005-02-24  Robert Ögren  <gtk@roboros.com>

	Implement better handling of Wintab tablet context overlap on
	Win32. (#167298)

	* gdk/win32/gdkinput-win32.c (_gdk_input_set_tablet_active): New
	function that brings any tablet contexts to the top of the overlap
	order.
	* gdk/win32/gdkinput-win32.h: Declare _gdk_input_set_tablet_active ()
	* gdk/win32/gdkevents-win32.c (gdk_event_translate):
	Call _gdk_input_set_tablet_active when a window is activated (on
	WM_ACTIVATE)
2005-02-25 00:12:32 +00:00
Tor Lillqvist
7a2e34562c New functions, code blocks refactored out of update_keymap(). No
2005-02-01  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkkeys-win32.c (handle_special, set_shift_vks,
	reset_after_dead, handle_dead): New functions, code blocks
	refactored out of update_keymap(). No functionality change.

	(update_keymap): Use ToUnicodeEx() when available (on NT-based
	Windows) instead of ToAsciiEx(). Makes keyboard input work in
	Unicode-only input locales that don't have any ANSI codepage, for
	instance Hindi and Bengali. Use _gdk_input_codepage only on
	Win9x. (#165723)

	* gdk/win32/gdkevents-win32.c (gdk_event_translate): On
	WM_INPUTLANGCHANGE, use GetLocaleInfo() instead of
	TranslateCharsetInfo() to get the input locale's corresponding
	codepage, if any.
2005-02-01 11:26:05 +00:00
Tor Lillqvist
736f4c8758 Fix for #163702, from Ivan Wong:
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.
2005-01-23 00:38:17 +00:00
Matthias Clasen
d7e3747b49 Fix a copy-and-paste error. (#158459)
2004-11-16  Matthias Clasen  <mclasen@redhat.com>

	* gdk/win32/gdkevents-win32.c (gdk_event_translate): Fix a
	copy-and-paste error.  (#158459)
2004-11-16 17:32:15 +00:00
Tor Lillqvist
430a02d854 Fix for #137551, by Robert Ögren:
2004-11-11  Tor Lillqvist  <tml@iki.fi>

	Fix for #137551, by Robert Ögren:

	* gdk/win32/gdkevents-win32.c (generate_focus_event): New function.

	(gdk_keyboard_grab, gdk_keyboard_ungrab): Generate focus change
	events.

	(gdk_event_translate): Check for keyboard grabs and not pointer
	grabs when handling WM_{SET,KILL}FOCUS. Use generate_focus_event().
2004-11-11 22:00:11 +00:00
Tor Lillqvist
34cbb87cc3 Event timestamps don't have to be unique. As long as they are
2004-11-10  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkevents-win32.c (_gdk_win32_get_next_tick):
	Event timestamps don't have to be unique. As long as they are
	nondecreasing we should be fine. Solves problems with for instance
	long menus not staying up on first click. (#152035, Robert Ögren)
2004-11-10 22:04:47 +00:00
Tor Lillqvist
a841d12888 gdk/win32/gdkprivate-win32.h gdk/win32/gdkglobals-win32.c Remove
2004-10-31  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkglobals-win32.c
	* gdk/win32/gdkmain-win32.c: Remove _windows_version and the
	IS_WIN_NT() macro.

	* gdk/win32/*.c: Use G_WIN32_IS_NT_BASED() from GLib instead.
2004-10-31 14:47:15 +00:00
Tor Lillqvist
f8ef369e78 List the three theme gtkrc files separately, zip doesn't do anything if
2004-09-03  Tor Lillqvist  <tml@iki.fi>

	* gtk-zip.sh.in: List the three theme gtkrc files separately, zip
	doesn't do anything if one of the files on its command line
	doesn't exist.

	Handle changes of screen resolution on Win32. (#151581, reported by
	Arjohn Kampman)

	* gdk/win32/gdkwindow-win32.c (_gdk_windowing_window_init,
	_gdk_root_window_size_init): Factor out setting the root window's
	size (as the size of the union of all monitors) to a new function.

	* gdk/win32/gdkdisplay-win32.c (gdk_display_open,
	_gdk_monitor_init): Factor out the monitor query to a new
	function.

	* gdk/win32/gdkprivate-win32.h: Declare above new functions.

	* gdk/win32/gdkevents-win32.c (gdk_event_translate,
	handle_display_change): Handle WM_DISPLAYCHANGE by calling the
	above two functions, and emitting the "size_changed" signal on our
	(only) GdkScreen.
2004-09-03 01:27:57 +00:00
Robert Ögren
c0ba86bc81 On Win32, do not produce tablet motion or button events while a window is
2004-08-28  Robert Ögren  <gtk@roboros.com>

	On Win32, do not produce tablet motion or button events while a
	window is being moved or resized. (#151090, reported by Shaneyfelt)

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkglobals-win32.c
	* gdk/win32/gdkevents-win32.c: Rename the variable resizing to
	_sizemove_in_progress and make it extern.

	* gdk/win32/gdkinput-win32.c (_gdk_input_other_event): Ignore
	motion and button events if _sizemove_in_progress is true.
2004-08-31 19:13:24 +00:00
Hans Breuer
2c3388b72f autogenerate gtk.def, cleanup
2004-08-09  Hans Breuer  <hans@breuer.org>

	* gtk/makefile.msc.in : autogenerate gtk.def, cleanup

	* gdk/win32/gdkwindow-win32.c gdk/win32/gdkevents-win32.c :
	removed long time unused ifdef/ed code (WITHOUT_WM_CREATE),
	removed duplicated call to gdk_window_set_cursor()
2004-08-09 21:32:58 +00:00
Tor Lillqvist
5f7fbb27c2 WM_WINDOWPOSCHANGED): Add _gdk_offset_{x,y} to top-level window
2004-08-07  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkevents-win32.c (handle_configure_event,
	gdk_event_translate:WM_WINDOWPOSCHANGED): Add _gdk_offset_{x,y} to
	top-level window coordinates, not just in generated
	events. (#148526, Robert Ögren)
2004-08-07 21:46:28 +00:00
Robert Ögren
fb88ec7208 Don't propagate mouse events to windows that want extended input events.
2004-05-11  Robert Ögren  <gtk@roboros.com>

	* gdk/win32/gdkevents-win32.c (propagate): Don't propagate mouse
	events to windows that want extended input events. (#142943)
	(gdk_event_translate): Move check for extended input devices to
	propagate, new parameter to propagate.
	(gdk_pointer_grab, gdk_display_pointer_ungrab): Enable calls to
	_gdk_input_(un)grab_pointer. (#142943)

	* gdk/win32/gdkinput-win32.c (_gdk_input_other_event): Check for
	input grab. [Fix missing update of impl in "dijkstra" event
	propagation loop] Drop the parallel "impl" pointer, just use a
	cast. Don't propagate beyond windows that want normal input
	events. (#142943)
	(gdk_input_grab_pointer, gdk_input_ungrab_pointer): Limited
	implementation of input grab. (#142943)
2004-05-24 22:34:55 +00:00
Robert Ögren
c4f723597b Add missing call to g_object_ref in Wintab code. (#138341)
2004-05-11  Robert Ögren  <gtk@roboros.com>

	* gdk/win32/gdkevents-win32.c (gdk_event_translate): Add missing
	call to g_object_ref in Wintab code. (#138341)

	* gdk/win32/gdkinput-win32.c: Fix numerous Wintab problems
	including unallocated buffers for event->motion.axes and
	event->button.axes, unsigned wraparound problem in the code for
	detecting missing press/release events and assigning min instead
	of max when setting up axes.
2004-05-12 23:30:27 +00:00
Hans Breuer
f0afa3a497 applied the undisputable and required [due to recent gtkfilesystem
2004-03-20  Hans Breuer  <hans@breuer.org>

	* gtk/gtkfilesystemwin32.c : applied the undisputable and
	required [due to recent gtkfilesystem internal api semantic
	changes] part of patches to fix bug #137543 (Tor Lillqvist,
	J. Ali Harlow)

	* gdk/gdkevents-win32.c (handle_configure_event) :
             (gdk_event_translate), WM_WINDOWPOSCHANGED : initialize
	GdkWindowObject::x, y with screen coords to make
	gdk_window_get_position () return the right thing and thus fix
	drag and drop positioning (e.g. Gimp tabs, fixes bug #137192)
2004-03-20 23:45:35 +00:00
Tor Lillqvist
6e5d959730 Set also the pointer button bits. (#136636, Dave Neary)
2004-03-10  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkevents-win32.c (build_key_event_state): Set also
	the pointer button bits. (#136636, Dave Neary)

	* gdk/win32/gdkwindow-win32.c (show_window_internal): Show
	transparent (input only) windows using SetWindowPos(). (#132331,
	John Ehresman)

	(gdk_window_set_type_hint): For splash screens, remove the resize
	handles, menu, and minimize/maximize/close buttons. (#132896)
2004-03-10 22:20:36 +00:00