1. 16 Mar, 2005 2 commits
    • Tor Lillqvist's avatar
      gdk/win32/gdkprivate-win32.h Drop global variable _gdk_root_window, just · 34bfd712
      Tor Lillqvist authored
      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.
      34bfd712
    • 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
  2. 15 Mar, 2005 1 commit
    • Tor Lillqvist's avatar
      New debugging function. As GetKeyNameText() returns a localized key name · 7c12edeb
      Tor Lillqvist authored
      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.
      7c12edeb
  3. 25 Feb, 2005 1 commit
    • Robert Ögren's avatar
      Implement better handling of Wintab tablet context overlap on Win32. · 81c1b1da
      Robert Ögren authored
      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)
      81c1b1da
  4. 01 Feb, 2005 1 commit
    • Tor Lillqvist's avatar
      New functions, code blocks refactored out of update_keymap(). No · 7a2e3456
      Tor Lillqvist authored
      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.
      7a2e3456
  5. 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
  6. 16 Nov, 2004 1 commit
  7. 11 Nov, 2004 1 commit
    • Tor Lillqvist's avatar
      Fix for #137551, by Robert Ögren: · 430a02d8
      Tor Lillqvist authored
      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().
      430a02d8
  8. 10 Nov, 2004 1 commit
    • Tor Lillqvist's avatar
      Event timestamps don't have to be unique. As long as they are · 34cbb87c
      Tor Lillqvist authored
      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)
      34cbb87c
  9. 31 Oct, 2004 1 commit
  10. 03 Sep, 2004 1 commit
    • Tor Lillqvist's avatar
      List the three theme gtkrc files separately, zip doesn't do anything if · f8ef369e
      Tor Lillqvist authored
      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.
      f8ef369e
  11. 31 Aug, 2004 1 commit
    • Robert Ögren's avatar
      On Win32, do not produce tablet motion or button events while a window is · c0ba86bc
      Robert Ögren authored
      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.
      c0ba86bc
  12. 09 Aug, 2004 1 commit
    • Hans Breuer's avatar
      autogenerate gtk.def, cleanup · 2c3388b7
      Hans Breuer authored
      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()
      2c3388b7
  13. 07 Aug, 2004 1 commit
  14. 24 May, 2004 1 commit
    • Robert Ögren's avatar
      Don't propagate mouse events to windows that want extended input events. · fb88ec72
      Robert Ögren authored
      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)
      fb88ec72
  15. 12 May, 2004 1 commit
    • Robert Ögren's avatar
      Add missing call to g_object_ref in Wintab code. (#138341) · c4f72359
      Robert Ögren authored
      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.
      c4f72359
  16. 20 Mar, 2004 1 commit
    • Hans Breuer's avatar
      applied the undisputable and required [due to recent gtkfilesystem · f0afa3a4
      Hans Breuer authored
      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)
      f0afa3a4
  17. 10 Mar, 2004 1 commit
    • Tor Lillqvist's avatar
      Set also the pointer button bits. (#136636, Dave Neary) · 6e5d9597
      Tor Lillqvist authored
      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)
      6e5d9597
  18. 06 Mar, 2004 1 commit
  19. 05 Mar, 2004 1 commit
    • Tor Lillqvist's avatar
      Add missing entries, thanks to J. Ali Harlow. · 72d622fc
      Tor Lillqvist authored
      2004-03-05  Tor Lillqvist  <tml@iki.fi>
      
      	* gdk/gdk.def: Add missing entries, thanks to J. Ali Harlow.
      
      	* gdk/win32/gdkcursor-win32.c (color_is_white): const-correctness.
      
      	(gdk_cursor_new_from_pixbuf): Copy of the non-Xcursor X11
      	implementation.
      
      	(gdk_display_supports_cursor_alpha,
      	gdk_display_supports_cursor_color): Dummy implementations.
      
      	(gdk_display_get_default_cursor_size,
      	gdk_display_get_maximal_cursor_size): Implement.
      
      	* gdk/win32/gdkdisplay-win32.c (gdk_display_get_default_group):
      	Dummy implementation.
      
      	* gdk/win32/gdkevents-win32.c (gdk_net_wm_supports): Dummy
      	implementation.
      
      	* gdk/win32/gdkfont-win32.c (gdk_font_get_display): Implement.
      
      	* gdk/win32/gdkinput-win32.c (gdk_input_motion_events): Remove,
      	not in API.
      
      	* gdk/win32/gdkwindow-win32.c (gdk_window_get_group): Dummy
      	implementation.
      72d622fc
  20. 28 Feb, 2004 1 commit
    • Hans Breuer's avatar
      set current_dest_drag to NULL when destroying, fixes bug #120007. Also · 75aa148d
      Hans Breuer authored
      2004-02-28  Hans Breuer  <hans@breuer.org>
      
      	* gdk/win32/gdkdnd-win32.c : set current_dest_drag to NULL
      	when destroying, fixes bug #120007. Also removed the mirrored
      	ref counting for deprecated gdk_drag_context_<ref|unref>()
      	cause it wasn't reliable anymore anyway.
      
      	* gdk/win32/gdkdisplay-win32.c : fix typo, which should
      	have broken the win32 build for everyone not using msvc
      
      	* gdk/win32/gdkevents-win32.c : WM_GETMINAMXINFO ensure not to
      	return negative values for ptMaxTrackSize, it caused snapping
      	windows to their minimum size
      75aa148d
  21. 26 Feb, 2004 1 commit
    • Owen Taylor's avatar
      Return GDK_FILTER_CONTINUE for unhandled message types. · 04ebfe94
      Owen Taylor authored
      Thu Feb 26 17:29:04 2004  Owen Taylor  <otaylor@redhat.com>
      
              * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Return
              GDK_FILTER_CONTINUE for unhandled message types.
      
              * gdk/x11/gdkevents-x11.c (gdk_event_translate): Allow
              multiple filters for the same event type with the standard
              "GDK_FILTER_CONTINUE == pretend I wasn't here" semantics.
      
              * gdk/x11/gdkevents-x11.c (gdk_display_add_client_message_filter):
              Append to the filter list not prepend, since order now matters.
      
              * gdk/win32/gdkevents-win32.c (gdk_add_client_message_filter):
              Append to the filter list not prepend, since order now matters.
      04ebfe94
  22. 02 Feb, 2004 1 commit
  23. 28 Jan, 2004 1 commit
    • Tor Lillqvist's avatar
      Don' generate enter or leave events if the pointer is grabbed with · 4263ea15
      Tor Lillqvist authored
      2004-01-28  Tor Lillqvist  <tml@iki.fi>
      
      	* gdk/win32/gdkevents-win32.c (synthesize_leave_event,
      	synthesize_enter_event): Don' generate enter or leave events if
      	the pointer is grabbed with owner_events off, and the grab event
      	mask doesn't ask for them. (#129242)
      
      	(gdk_event_translate): Ditto for focus change events.
      4263ea15
  24. 14 Dec, 2003 2 commits
    • Hans Breuer's avatar
      handle GTK_DATADIR similar as the other filesystem placement 'constants' · 4acd98a8
      Hans Breuer authored
      2003-12-14  Hans Breuer  <hans@breuer.org>
      
      	* gtk/gtkprivate.h gtk/gtkmain.c : handle GTK_DATADIR
      	similar as the other filesystem placement 'constants' (dynamic
      	resolving on win32)
      
      	* gtk/gtkfilechooserwidget.c : handle file system to win32
      	renaming here as will
      	* gtk/gtkfilesystemwin32.c : implement render_icon
      
      	* gtk/gtk.def gdk/gdk.def : updated externals
      
      	* gdk/win32/gdkdisplay-win32.c : make it compile without
      	<multimon.h> - i.e. even older sdk
      
      	* gdk/win32/gdkevents-win32.c : match resize_timer_proc
      	with TIMERPROC prototype
      
      	* gdk/win32/gdkwindow-win32.c : older msvc does not know
      	BITMAPV5HEADER (from win xp) either
      
      	* gtk/gtkimmodule.c : make it compile even if GTK_LOCALEDIR is
      	not defined
      
      	* tests/testfilechooser.c : recent GLib crashes on
      	g_print ("%s", NULL) so avoid this
      4acd98a8
    • Tor Lillqvist's avatar
      Merge from stable: · 5cd59c1c
      Tor Lillqvist authored
      2003-12-14  Tor Lillqvist  <tml@iki.fi>
      
      	Merge from stable:
      
      	* gdk/gdkdisplaymanager.c: Mark default_display static.
      
      	* gdk/win32/gdkdnd-win32.c: Mark current_dest_drag static.
      
      	* gdk/win32/gdkkeys-win32.c: Disable some overly verbose debugging
      	output.
      
      	* gdk/win32/gdkevents-win32.c: Clean up the debugging output from
      	--gdk-debug=events. In general, output just one line of debugging
      	output for each Windows message, plus one line for each GDK event
      	generated. Indent all lines according to window procedure nesting
      	level.
      
      	(inner_window_procedure): Rename from real_window_procedure.
      
      	(find_real_window_for_grabbed_mouse_event): Don't get misled when
      	the point is in the non-client (decoration) area of the window
      	returned by WindowFromPoint(). Return the root window in that
      	case.
      
      	(build_pointer_event_state): Test also MK_XBUTTON1 and
      	MK_XBUTTON2 (buttons 4 and 5).
      
      	(synthesize_enter_event): Track the mouse leaving the window in
      	the event being generated, not the one mentioned in the Windows
      	message.
      
      	(propagate): Test for NULL parent earlier. Improves event
      	generation from a grabbed pointer. Part of fix for #107320.
      
      	(handle_stuff_while_moving_or_resizing): New function, to
      	dispatch the main loop (once).
      
      	(resize_timer_proc): New function, set to be called by an inerval
      	timer during resizes/moves. Calls handle_stuff_while_moving_or_resizing().
      
      	(gdk_event_translate): Drop unused return_exposes parameter.
      
      	Handle WM_XBUTTONDOWN and UP messages (buttons 4 and 5).
      
      	On WM_SYSKEYUP, generate a key release event also for just the Alt
      	key.
      
      	On WM_MOUSELEAVE, generate a leave event of type
      	GDK_NOTIFY_ANCESTOR (and not UNKNOWN) if the mouse left a
      	top-level window, and left the app completely.
      
      	On WM_ENTERSIZEMOVE, set a flag, and start an interval timer that
      	calls resize_timer_proc() at regular intervals. On
      	WM_EXITSIZEMOVE, kill the timer.
      
      	On WM_WINDOWPOSCHANGED, generate a configure event if necessary,
      	and dispatch the main loop (by calling
      	handle_stuff_while_moving_or_resizing()). Fixes #99540, idea by
      	Herman Bloggs.
      
      	* gdk/win32/gdkmain-win32.c (_gdk_win32_message_to_string): Handle
      	also wintab messages.
      
      	* gdk/win32/gdkwindow-win32.c (gdk_window_set_skip_taskbar_hint):
      	Instead of using WS_EX_TOOLWINDOW, implement by setting/unsetting
      	the window's owner. Fixes #118093, reported by Maxime Romano.
      5cd59c1c
  25. 07 Dec, 2003 1 commit
  26. 25 Sep, 2003 1 commit
    • Tor Lillqvist's avatar
      Don't use hardcoded DEMOCODEDIR on Windows. · 4a2de86c
      Tor Lillqvist authored
      2003-09-25  Tor Lillqvist  <tml@iki.fi>
      
      	* demos/gtk-demo/main.c: Don't use hardcoded DEMOCODEDIR on Windows.
      
      2003-09-21  Tor Lillqvist  <tml@iki.fi>
      
      	* gdk/win32/gdkevents-win32.c (handle_wm_paint): New
      	function. Code split out from gdk_event_translate(). Needed
      	because gdk_event_get_graphics_expose() couldn't do anything
      	sensible otherwise. (Not that I think graphics exposes work anyway
      	in gdk/win32, but at least now the code could work.)
      
      	(gdk_event_get_graphics_expose): Call handle_wm_paint() instead of
      	gdk_event_translate(), which couldn't have worked as it doesn't
      	take any pre-allocated GdkEvent parameter any longer.
      
      	(gdk_event_translate): Handle WM_MOUSEACTIVATE: Don't let
      	GDK_WINDOW_TEMP windows be activated. (#122578, John Ehresman)
      4a2de86c
  27. 08 Aug, 2003 1 commit
    • Tor Lillqvist's avatar
      Print also the root coordinates for events that have such. Print · ad24b9ca
      Tor Lillqvist authored
      2003-08-08  Tor Lillqvist  <tml@iki.fi>
      
      	* gdk/win32/gdkevents-win32.c (print_event): Print also the root
      	coordinates for events that have such. Print coordinates for enter
      	and leave events.
      
      	(gdk_event_translate): Don't use event uninitialixed in the
      	return_exposes branch of the WM_PAINT handler.
      
      	* gdk/win32/gdkwindow-win32.c (gdk_window_new,
      	_gdk_windowing_window_get_pointer, _gdk_windowing_window_at_pointer):
      	Must offset top-level window coordinates here, too.
      ad24b9ca
  28. 07 Aug, 2003 2 commits
    • Tor Lillqvist's avatar
      gdk/win32/gdkinput-win32.h Drop the GdkEvent* parameter, it wasn't used. · 5155f3ca
      Tor Lillqvist authored
      2003-08-07  Tor Lillqvist  <tml@iki.fi>
      
      	* gdk/win32/gdkinput-win32.h
      	* gdk/win32/gdkinput-win32.c (_gdk_input_configure_event,
      	_gdk_input_enter_event): Drop the GdkEvent* parameter, it wasn't
      	used.
      
      	* gdk/win32/gdkevents-win32.c (gdk_event_translate): Adapt caller
      	accordingly, in fact an uninitialised variable was dereferenced.
      
      
      	[Win32] Add support for multiple monitors.
      
      	* gdk/win32/gdkprivate-win32.h
      	* gdk/win32/gdkglobals-win32.c: New global variables for
      	multiple-monitor info: _gdk_num_monitors, _gdk_monitors, and
      	_gdk_offset_x and _gdk_offset_y.
      
      	* gdk/win32/gdkdisplay-win32.c (count_monitor, enum_monitor): New
      	functions, enumeration functions passed to EnumDisplayMonitors().
      
      	(gdk_display_open): If the EnumDisplayMonitors() and
      	GetMonitorInfo() API is present (on Win98, Win2000 and newer), use
      	if to find out monitor info.
      
      	Calculate the offset between Win32 coordinates (relative to the
      	primary monitor's origin (and thus negative on monitors to the
      	left of or above it), and GDK's (visible coordinates should be
      	non-negative).
      
      	* gdk/win32/gdkscreen-win32 (gdk_screen_get_n_monitors,
      	gdk_screen_get_monitor_geometry): Use information collected above.
      
      	(gdk_window_move, gdk_window_move_resize_window_get_geometry):
      	Subtract _gdk_offset_{x,y} from GDK root window coordinates.
      
      	(gdk_window_get_geometry, gdk_window_get_origin,
      	gdk_window_get_frame_extents): For top-level windows, add
      	_gdk_offset_{x,y} to GDK root window coordinates
      
      	Still need to handle multiple monitors in
      	gdk_window_fullscreen(). Probably should make the window
      	fullscreen on the monitor where the cursor is?
      
      	* gdk/win32/gdkevents-win32.c: Add _gdk_offset_{x,y} to all GDK
      	root window coordinates in GdkEvents.
      
      
      	[Win32] Fix geometry hint handling. Add support for resize
      	increment and base size, and aspect ratio geometry hints. The
      	"gridded geometry" test in testgtk now works beautifully.
      
      	* gdk/win32/gdkwindow-win32.c (gdk_window_set_geometry_hints):
      	Turns out this function shouldn't actually ever modify the
      	window's size, just store the hints. (Old code kept for a while
      	inside #if 0.)
      
      	(gdk_window_set_hints): Remove presumably broken code that handles
      	the position hints, this function is obsolete anyway.
      
      	* gdk/win32/gdkevents-win32.c: Drop the current_{x,y}_root
      	variables, not used.
      
      	(adjust_drag): New function, used to implement resize increment
      	hints.
      
      	(gdk_event_translate): Handle WM_SIZING, implement resize
      	increment and base size, and aspect ratio geometry hints here. The
      	WM_GETMINMAXINFO handler takes care of the minimum and maximum
      	size hints as before. Fix the WM_GETMINMAXINFO handler to take
      	into account window decorations. No need to modify the
      	ptMaxPosition and ptMaxSize fields in the MINMAXINFO struct,
      	the defaults are fine.
      
      	* gdk/win32/gdkprivate-win32.h
      	* gdk/win32/gdkwindow-win32.c (_gdk_win32_adjust_client_rect,
      	_gdk_win32_get_adjusted_client_rect): New helper functions.
      5155f3ca
    • Hans Breuer's avatar
      finally use TrackMouseEvent (only if the new window not known to Gdk) to · 1ea3b450
      Hans Breuer authored
      2003-08-07  Hans Breuer  <hans@breuer.org>
      
      	* gdk/win32/gdkevents-win32.c : finally use TrackMouseEvent
      	(only if the new window not known to Gdk) to get proper
      	leave notification, and get rid of the wrong placed
      	tooltips, bug #102283
      
      	(gdk_event_translate) : small code reordering to not get
      	GDK_MOTION_NOTIFY for still mouse and get back tooltips on
      	menus, bug #117367
      1ea3b450
  29. 04 Aug, 2003 1 commit
    • Tor Lillqvist's avatar
      2003-08-04 Tor Lillqvist <tml@iki.fi · b9987ad7
      Tor Lillqvist authored
      	* gdk/win32/gdkevents-win32.c (apply_filters): Fix braino:
      	actually use the passed-in filter list. The function also needs a
      	GdkWindow parameter, as filter functions expect
      	GdkEvent::any.window to be valid. (#119034, Hans Breuer)
      b9987ad7
  30. 02 Aug, 2003 1 commit
    • Tor Lillqvist's avatar
      Fix gdk/win32 window geometry handling again. The window position in a · 3dc24f58
      Tor Lillqvist authored
      2003-08-02  Tor Lillqvist  <tml@iki.fi>
      
      	Fix gdk/win32 window geometry handling again. The window position
      	in a GDK_CONFIGURE event should be that of the client area, not of
      	the window decorations. (I was confused by the term "window
      	border" in X11. It does *not* mean the window manager
      	decorations. There are no X11-style window borders in Win32.)
      	Also, this time do take the geometry hints into account
      	appropriately when moving windows. Now testgtk's gravity test's
      	move buttons work OK. There are stil problems with taking gravity
      	into account when showing a hidden window.
      
      	* gdk/win32/gdkwindow-win32.h: Keep a whole GdkGeometry as hints
      	instead of separate fields.
      
      	* gdk/win32/gdkevents-win32.c (handle_configure_event): Don't
      	adjust for decorations.
      
      	* gdk/win32/gdkwindow-win32.c (get_outer_rect,
      	adjust_for_gravity_hints): New functions.
      	(gdk_window_move, gdk_window_resize, gdk_window_move_resize): Use
      	above functions, take geometry hints into account.
      	(gdk_window_set_geometry_hints): Size hints specicy client area,
      	not including decorations.
      3dc24f58
  31. 29 Jul, 2003 1 commit
    • Tor Lillqvist's avatar
      Fix for #108007, #112402, #117042: There was confusion in gdk/win32 at · 09f777e5
      Tor Lillqvist authored
      2003-07-29  Tor Lillqvist  <tml@iki.fi>
      
      	Fix for #108007, #112402, #117042: There was confusion in
      	gdk/win32 at various places whether a window position refers to
      	the decoration position or the client area position. Also whether
      	window size includes decorations or not.
      
      	The correct interpretation apparently is that in GDK (like in
      	X11), a top-level window position means the decoration's position,
      	but size means the window's inner size (client area size). In the
      	Win32 API, the window size usually includes the decorations,
      	though.
      
      	* gdk/win32/gdkevents-win32.c (decode_key_lparam): Move inside
      	#ifdef G_ENABLE_DEBUG.
      	(handle_configure_event): New function, generates GDK_CONFIGURE
      	events from WM_SIZE and WM_MOVE messages. Even if no event is
      	generated because of the event mask, still set the private
      	position and size fields. Calculate position and size correctly.
      	(gdk_event_translate): Call handle_configure_event().
      
      	* gdk/win32/gdkgeometry-win32.c: Cosmetics.
      
      	* gdk/win32/gdkwindow-win32.c: Use GDI_CALL() and API_CALL()
      	macros. Cosmetic debugging output changes.
      	(SafeAdjustWindowRectEx): Remove. If an application wants to
      	locate a window outside of the screen, it's not GDK's business to
      	prevent it. And anyway, with multiple monitors, negative
      	coordinates are perfectly normal.
      	(gdk_window_new): Adjust the window size for decorations after
      	_gdk_window_init_position() has done its job. (But the big window
      	code currently is presumably broken on Win32 anyway.)
      	(gdk_window_move): The position passed in is supposed to be that
      	of the window border, so don't need to adjust for decorations.
      	(gdk_window_resize, gdk_window_move_resize): Simplify somewhat.
      09f777e5
  32. 27 Jul, 2003 1 commit
    • Tor Lillqvist's avatar
      On Win9x, the keyboard state returned by GetKeyboardState() doesn't · 165375eb
      Tor Lillqvist authored
      2003-07-27  Tor Lillqvist  <tml@iki.fi>
      
      	* gdk/win32/gdkevents-win32.c (build_key_event_state): On Win9x,
      	the keyboard state returned by GetKeyboardState() doesn't
      	distinguish between the left and right Control and Alt keys. Thus
      	we cannot detect AltGr (which is supposed to be left Control +
      	right Alt) the same way as on NT-based systems, but have to accept
      	either Control + either Alt as AltGr.
      165375eb
  33. 26 Jul, 2003 1 commit
    • Tor Lillqvist's avatar
      gdk/win32/gdkprivate-win32.h New flags _gdk_input_locale_is_ime and · 63f74573
      Tor Lillqvist authored
      2003-07-25  Tor Lillqvist  <tml@iki.fi>
      
      	* gdk/win32/gdkprivate-win32.h
      	* gdk/win32/gdkglobals-win32.c: New flags _gdk_input_locale_is_ime
      	and _gdk_keyboard_has_altgr.
      
      	* gdk/win32/gdkevents-win32.c: Lots of changes. Most important
      	ones detailled here.
      
      	Code that has been ifdeffed out for a long time removed. Remove
      	some really old doc comments that were left behind for some public
      	functions, the official ones are in the X11 backend anyway. Change
      	GDK_WINDOW_OBJECT() calls to GdkWindowObject casts. Reformat
      	multi-line boolean expressions to have the operators at ends of
      	lines.
      
      	As mouse capture with SetCapture() indeed seems to work OK, no
      	need to have the correspoinding macro USE_SETCAPTURE and ifdefs.
      
      	Ifdef out the gdk-ping-msg stuff. I don't remember why it was
      	needed at some time, and things seem to work fine now without
      	(knock on wood).
      
      	Ifdef out the search for some Latin locale keyboard layout being
      	loaded. Not used currently, but might be needed after all, if we
      	decide that we want to be able to generate ASCII control character
      	events with a non-Latin keyboard.
      
      	(assign_object): New helper function, handles the g_object_ref()
      	and unref() calls when assigning GObject pointers.
      
      	(generate_crossing_events): Also generate the GDK_NOTIFY_INTERIOR
      	enter event when the pointer has moved to an ancestor window. Was
      	left out by mistake.
      
      	(gdk_window_is_ancestor): Renamed from gdk_window_is_child().
      
      	(gdk_pointer_grab, gdk_pointer_ungrab): Implement the confine_to
      	functionality, using ClipCursor().
      
      	(find_window_for_mouse_event): Splice part of code into new
      	function find_real_window_for_grabbed_mouse_event().
      
      	(fixup_event, append_event, apply_filters): New functions, code
      	refactored out from elsewhere.
      
      	(synthesize_enter_or_leave_event, synthesize_leave_event,
      	synthesize_enter_event,
      	synthesize_leave_events,synthesize_enter_events): Also take a
      	GdkCrossingMode parameter, in preparation to generating
      	GDK_CROSSING_GRAB and GDK_CROSSING_UNGRAB events.
      
      	(fixup_event, append_event, fill_key_event_string): New functions,
      	code refactoring.
      
      	(vk_from_char, build_keypress_event, build_keyrelease_event):
      	Removed as part of dropping WM_CHAR handling.
      
      	(build_key_event_state,gdk_event_translate): Call
      	GetKeyboardState(), once, for each keyboard message, instead of
      	several calls to GetKeyState() here and there.
      
      	(gdk_event_translate): Fix bugs #104516, #104662, #115902. While
      	at it, do some major refactoring, and some fixes for potential
      	problems noticed while going through the code.
      
      	Don't handle WM_CHAR at all. Only handle WM_KEYDOWN and
      	WM_KEYUP. Don't need the state variables related to whether to
      	wait for WM_CHAR or not, and whether the current key is
      	AltGr. Remove lots of complexity. Thus don't need the
      	use_ime_composition flag.
      
      	Not handling WM_CHAR means dead key handling will have to be taken
      	care of by GTK, but that seems to work fine, so no worry.
      
      	Another side-effect is that Alt+keypad digits don't work any
      	longer, but it's better to learn to use GTK's ISO14755 support is
      	anyway.
      
      	Be more careful in checking whether AltGr is involved. Only
      	attempt to handle it if the keyboard actually has it. And
      	explicitly check for *left* Control plus *right* Alt being
      	pressed. Still, allow (left) Alt and/or (right) Control with AltGr
      	chars.
      
      	Handle keys using similar code as in the X11 backend. As we have
      	built a keymap in gdkkeys-win32.c anyway, use it by calling
      	gdk_keymap_translate_keyboard_state() to look up the keysym from
      	the virtual key code and keyboard state. Build the key event
      	string in exactly the same way as the X11 backend.
      
      	If an IME is being used, don't generate GDK events for keys
      	between receiving WM_IME_STARTCOMPOSITION and
      	WM_IME_ENDCOMPOSITION, as those keys are for the IME.
      
      	For WM_IME_COMPOSITION, handle all the Unicode chars returned from
      	the IME, not just the first one.
      
      	gdk_event_translate() is still quite complex, could split the
      	message handler cases out into separate functions.
      
      	On mouse events, when the mouse is grabbed, use
      	find_real_window_for_grabbed_mouse_event() in order to be able to
      	generate correct crossing events.
      
      	No longer take a pre-allocated GdkEvent as parameter. Instead,
      	allocate events as needed and append them to the queue. (This is
      	different from how gdk_event_translate() in the X11 backend
      	works.) This change made the code much clearer, especially in the
      	cases where we have to generate several GDK events for one Windows
      	message.  Return FALSE if DefWindowProc() should be called, TRUE
      	if not. If DefWindowProc() should not be called, also return the
      	value to be returned from the window procedure.
      
      	(Previously, the interaction with gdk_event_translate()'s caller
      	was much more complex, when we had to indicate whether the
      	already-queued event should be left in the queue or removed, and
      	in addition also had to indicate whether to call DefWindowProc()
      	or not, and what value to return from the window procedure if
      	not.)
      
      	Don't use a separate "private" variable required to be pointing to
      	the GdkWindowObject of the "window" variable at all times. Just
      	use casts, even if looks a bit uglier.
      
      	Notice destroyed windows as early as possible, and break out of
      	the messsage switch.
      
      	Use _gdk_pointer_root as current_window when the pointer is
      	outside GDK's top-level windows.
      
      	On WM_INPUTLANGCHANGE, set _gdk_input_locale_is_ime as
      	appropriate, based on ImmIsIME().
      
      	(gdk_event_translate, gdk_event_send_client_message_for_display,
      	gdk_screen_broadcast_client_message): Implement client messages.
      	Use a registered Windows message to pass GDK client messages. Note
      	that the amount of user data is restricted to four bytes, as it is
      	carried in the LPARAM. (The WPARAM is used for the message type
      	"atom".)
      
      	(real_window_procedure): Adapt for new gdk_event_translate()
      	interface.
      
      	* gdk/win32/gdkmain-win32.c (_gdk_windowing_init): Set
      	_gdk_input_locale_is_ime initially.
      
      	* gdk/win32/gdkwindow-win32.c: Use g_object_ref()/unref() instead
      	of g_colormap_ref()/unref().
      
      	(gdk_window_new): Made code a bit more like the X11 one, pretend
      	to handle screens (although we just have one for now).
      
      	* gdk/x11/gdkevents-x11.c
      	(gdk_event_send_client_message_for_display,
      	gdk_screen_broadcast_client_message): Document the user data
      	limitation on Win32.
      
      	* gdk/win32/gdkevents-win32.c (print_event): More complete enter
      	and leave notify detail output.
      
      	* gdk/win32/gdkkeys-win32.c (update_keymap): Make dead keys
      	visible to GDK and GTK. Store the corresponding GDK_dead_* keysym
      	for those, so that the GtkIMContextCimple compose tables will
      	work. Deduce if the keyboard layout has the AltGr key, and set the
      	above flag accordingly.
      63f74573
  34. 20 Jul, 2003 1 commit
    • Hans Breuer's avatar
      new file to build it all ... added to EXTRA_DIST · 364272b5
      Hans Breuer authored
      2003-07-20  Hans Breuer  <hans@breuer.org>
      
      	* makefile.msc : new file to build it all
      	* Makefile.am : ... added to EXTRA_DIST
      
      	* gdk/makefile.msc gtk/stock-icons/makefile.msc
      	  gtk/makefile.msc.in tests/makefile.msc : updated
      
      	* gdk/gdk.def gtk/gtk.def : export a bunch of new
      	functions
      
      	* gtk/gtkbbox.c : use g_return_val_if_fail() if
      	there is a value to return
      
      	* gtk/gtkfontsel.c gtk/gtkiconfactory.c :
      	static correctness
      
      	* gtk/gtkicontheme.c : ported to use GTimeVal instead of
      	struct timeval and GTK_DATA_PREFIX instead of GTK_DATADIR
      
      	* gtk/gtkicontheme.c : use HAVE_LC_MESSAGES
      
      	* gtk/gtkimmulticontext.c : use gtkprivate.h
      
      	* gtk/stock-icons/stock_color_picker_25.png
      	  gtk/stock-icons/stock_jump_to_rtl_16.png
      	  gtk/stock-icons/stock_jump_to_rtl_24.png
      	  gtk/stock-icons/stock_redo_rtl_16.png
      	  gtk/stock-icons/stock_redo_rtl_24.png
      	  gtk/stock-icons/stock_undelete_rtl_16.png
      	  gtk/stock-icons/stock_undelete_rtl_24.png
      	  gtk/stock-icons/stock_undo_rtl_16.png :
      	  gtk/stock-icons/stock_undo_rtl_24.png :
      	readded as binary
      364272b5
  35. 05 Jul, 2003 1 commit
    • Owen Taylor's avatar
      Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap · 9bedbf66
      Owen Taylor authored
      Fri Jul  4 15:57:52 2003  Owen Taylor  <otaylor@redhat.com>
      
      	* gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter):
      	Use asynchronously _gdk_x11_set_input_focus_safe
      	to avoid having to trap errors and XSync().
      
      	* gdk/x11/gdkwindow-x11.c (gdk_window_focus): Use
      	_gdk_x11_set_input_focus_safe() here as well.
      
      	* gdk/x11/gdkevents-x11.c (gdk_check_wm_state_changed):
      	Rework handling of property notifies on _NET_WM_STATE
      	so that we ignore _NET_WM_DESKTOP notifies unless we
      	really care.
      
      	* gdk/x11/gdkimage-x11.c (gdk_image_check_xshm): Use
      	XShmQueryExtension() rather than XQueryExtension() to
      	avoid extra rountrip.
      
      	* gdk/x11/gdkwindow-x11.c (_gdk_windowing_window_init):
      	Remove unused call to XGetWindowAttributes()
      
      	* gdk/x11/gdkdisplay-x11.c (gdk_display_open): Remove
      	unused call to XGetKeyboardControl().
      
      	* gdk/x11/gdkdisplay-x11.c gdk/gdk.def (gdk_display_flush):
      	Add (#99571)
      
      	* gdk/win32/gdkevents-win32.c gdk/linux-fb/gdkevents-fb.c
      	No-op implementations of gdk_display_flush().
      
      	* gdk/gdkwindow.c (gdk_window_process_all_updates): Use
      	gdk_display_flush() rather than gdk_flush() to avoid
      	XSync().
      
      	* gdk/x11/gdkwindow-x11.c (update_wm_hints)
      	gdk/x11/gdkwindow-x11.h: Centralize all handling of WM_HINTS here
      	so that we don't have to get the property back from the server.
      
      	* gdk/x11/gdkwindow-x11.c (show_window_internal): Store
      	the serial of when we map a toplevel to allow optimizing
      	out notifies on _NET_WM_STATE/_NET_WM_DESKTOP.
      
      	* gdk/x11/gdkevents-x11.c (gdk_event_translate): Don't
      	XTranslateCoordinates() for override-redirect windows.
      
      Fri Jul  4 15:59:27 2003  Owen Taylor  <otaylor@redhat.com>
      
      	* gdk/x11/gdkwindow-x11.c (gdk_window_set_group): Remove comment
      	about setting window group after the window is mapped from docs
      	- nothing the ICCCM forbids that.
      
      	* gdk/x11/gdkcursor-x11.c (gdk_display_get_maximal_cursor_size):
      	Fix g_return_val_if_fail() in void return function.
      
      	* configure.in: Fix misplaced comma that was resulting
      	in XShm always being disabled.
      9bedbf66
  36. 30 Jun, 2003 1 commit
    • Tor Lillqvist's avatar
      New function, callback proc for EnumWindows(). · 33902a67
      Tor Lillqvist authored
      2003-06-30  Tor Lillqvist  <tml@iki.fi>
      
      	* gdk/win32/gdkdnd-win32.c (find_window_enum_proc): New function,
      	callback proc for EnumWindows().
      	(gdk_drag_find_window_for_screen): Actually take the drag_window
      	argument into account: Instead of using WindowFromPoint(), use
      	EnumWindows(), to be able to skip the drag_window. (#116320, Tony
      	M Brown, Herman Bloggs)
      
      	* gdk/win32/*.c: Replace gdk_drawable_ref()/unref() and
      	gdk_window_ref()/unref() calls with g_object_ref()/unref().
      	Consistently use %p format in debugging output of pointers and
      	HANDLEs.
      33902a67
  37. 22 Jun, 2003 1 commit
    • Tor Lillqvist's avatar
      When emulating X11's automatic grab on button down, pass owner_events as · 25359a2a
      Tor Lillqvist authored
      2003-06-21  Tor Lillqvist  <tml@iki.fi>
      
      	* gdk/win32/gdkevents-win32.c (gdk_event_translate): When
      	emulating X11's automatic grab on button down, pass owner_events
      	as FALSE. According to the XLib spec, automatic grabs use True for
      	owner_events when OwnerGrabButtonMask is selected, and I don't see
      	the X11 backend doing that. (#110271)
      	(find_window_for_pointer_event): Improve debugging output.
      25359a2a