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-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-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-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-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-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
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-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-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-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-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-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-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-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
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-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-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-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-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-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-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.
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-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-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 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-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-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-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-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-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 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-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-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 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-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-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-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-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.
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-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)