Commit Graph

1301 Commits

Author SHA1 Message Date
Noah Levitt
005194bc4b Elaborate a bit more in the docs on GdkFilterFunc and GdkFilterReturn.
2003-08-09  Noah Levitt  <nlevitt@columbia.edu>

	* gdk/gdkevents.h:
	* docs/reference/gdk/tmpl/windows.sgml: Elaborate a bit more in the
	docs on GdkFilterFunc and GdkFilterReturn.
2003-08-09 06:19:43 +00:00
Matthias Clasen
699e1c74ef Fix a segfault. (#115284, Jan Kratochvil)
2003-08-08  Matthias Clasen  <maclas@gmx.de>

	* gdk/gdkregion-generic.c (gdk_region_spans_intersect_foreach): Fix a segfault.  (#115284,
	Jan Kratochvil)
2003-08-08 21:39:19 +00:00
Tor Lillqvist
ad24b9cad6 Print also the root coordinates for events that have such. Print
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.
2003-08-08 07:16:16 +00:00
Tor Lillqvist
5155f3ca66 gdk/win32/gdkinput-win32.h Drop the GdkEvent* parameter, it wasn't used.
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.
2003-08-07 22:17:18 +00:00
Matthias Clasen
9bfaab6e77 Reset the toplevel->have_* flags before iterating over the _NET_WM_STATE
2003-08-07  Matthias Clasen  <maclas@gmx.de>

	* gdk/x11/gdkevents-x11.c (gdk_check_wm_state_changed): Reset the toplevel->have_* flags before
	iterating over the _NET_WM_STATE atoms.  (#119217)
2003-08-07 21:11:35 +00:00
Hans Breuer
1ea3b45078 finally use TrackMouseEvent (only if the new window not known to Gdk) to
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
2003-08-07 15:10:16 +00:00
Tor Lillqvist
209dc33b3b gdk/gdk.def Add missing function, trivially implement.
2003-08-07  Tor Lillqvist  <tml@iki.fi>

	* gdk/gdk.def
	* gdk/win32/gdkfont-win32.c (gdk_fontset_load_for_display): Add
	missing function, trivially implement.
2003-08-07 03:30:38 +00:00
Hans Breuer
8bc4568fa8 initialize bits to 0 (probably default on NT)
2003-08-06  Hans Breuer  <hans@breuer.org>

	* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_new) :
	initialize bits to 0 (probably default on NT)

	now really ...
2003-08-06 22:13:48 +00:00
Hans Breuer
d3b962ce0f initialize bits to 0 (probably default on NT)
2003-08-06  Hans Breuer  <hans@breuer.org>

	* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_new) :
	initialize bits to 0 (probably default on NT)
2003-08-06 22:08:33 +00:00
Hans Breuer
76cb03f43f now it works as intended ;-)
2003-08-06  Hans Breuer  <hans@breuer.org>

	* gdk/win32/gdkwindow-win32.c (gdk_window_set_icon) :
	now it works as intended ;-)
2003-08-06 21:01:00 +00:00
Hans Breuer
d2c64e305c set HWND_NOTOPMOST for modal==FALSE, fixes bug #118435
2003-08-04  Hans Breuer  <hans@breuer.org>

	* gdk/win32/gdkwindow-win32.c(gdk_window_set_modal_hint) :
	set HWND_NOTOPMOST for modal==FALSE, fixes bug #118435

	* gdk/win32/gdkwindow-win32.c : implement gdk_window_[un]fullscreen
	(gdk_window_{move,resize,move_rezize})) : noop if FULLSCREEN

	* gdk/win32/gdkwindow-win32.c (gdk_window_set_icon) :
	against all expectations it is basically ony a call with WM_SETICON
	needed (the visual effect is there, though colors or mask are
	still somewhat wrong).
	* gdk/win32/gdkwindow-win32.h : place to store the HICON

	* gdk/win32/gdkdrawabke.win32.c : readded the conditional end
	pixel drawing as it was fixed at 1999-08-23

	gtk/gtk.def : updated
2003-08-05 22:24:35 +00:00
Owen Taylor
72f1116387 Fix problem where use_xshm was getting set wrong if MIT_SHM wasn't found.
Mon Aug  4 14:53:46 2003  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkimage-x11.c (_gdk_windowing_image_init):
        Fix problem where use_xshm was getting set wrong if
        MIT_SHM wasn't found. (George Lebel)
2003-08-04 19:02:36 +00:00
Tor Lillqvist
b9987ad725 2003-08-04 Tor Lillqvist <tml@iki.fi
* 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)
2003-08-04 15:27:49 +00:00
Matthias Clasen
ee18c33dc9 Improve wording of the docs, avoid the term "virtual screen". (#119030,
2003-08-03  Matthias Clasen  <maclas@gmx.de>

	* gdk/x11/gdkscreen-x11.c (gdk_screen_get_n_monitors):
	(gdk_screen_get_monitor_geometry): Improve wording of the docs, avoid the
	term "virtual screen".  (#119030, Tor Lillquist)
2003-08-03 20:50:58 +00:00
Matthias Clasen
0df78ed774 Use g_setenv() instead of putenv(). 2003-08-02 21:35:44 +00:00
Owen Taylor
88c1c94651 Requires glib-2.3.0, pango-1.2.0.
Sat Aug  2 12:53:16 2003  Owen Taylor  <otaylor@redhat.com>

        * configure.in: Requires glib-2.3.0, pango-1.2.0.

        * configure.in: Require Xft version 2,
        remove code for handling older versions of pango and Xft.
        Many miscellaneous improvements to X checks

        * acinclude.m4: Add GTK_ADD_LIB() macro for adding
        a library to a variable, avoiding dups.

        * gdk/x11/gdkfont-x11.c (gdk_font_from_description_for_display):
        Always load "fixed"

        * gdk/x11/gdk*-x11.[ch]: Remove support for Xft1 and
        for pangox.
2003-08-02 17:50:09 +00:00
Tor Lillqvist
3dc24f5893 Fix gdk/win32 window geometry handling again. The window position in a
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.
2003-08-02 02:05:12 +00:00
Owen Taylor
10a3ddf6cc If the check for missing depths, try actually creating pixmaps of the
Fri Aug  1 16:30:13 2003  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkdrawable-x11.c (_gdk_x11_have_render):
        If the check for missing depths, try actually creating pixmaps
        of the depths to deal with Xinerama not reporting
        all the depths it should. (#115822)
2003-08-01 20:37:56 +00:00
Owen Taylor
4fbca22e4a g_set_prgname("<unknown>") if argc is 0 as well, instead of leaving it
Fri Aug  1 15:06:25 2003  Owen Taylor  <otaylor@redhat.com>

        * gdk/gdk.c (gdk_parse_args): g_set_prgname("<unknown>")
        if argc is 0 as well, instead of leaving it unset.
        (#116023, Michael Meeks)
2003-08-01 19:28:19 +00:00
Tor Lillqvist
09f777e5ea Fix for #108007, #112402, #117042: There was confusion in gdk/win32 at
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.
2003-07-29 23:35:40 +00:00
Tor Lillqvist
165375eb5c On Win9x, the keyboard state returned by GetKeyboardState() doesn't
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.
2003-07-27 21:58:44 +00:00
Tor Lillqvist
63f745738d gdk/win32/gdkprivate-win32.h New flags _gdk_input_locale_is_ime and
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.
2003-07-26 01:54:59 +00:00
Hans Breuer
364272b5b9 new file to build it all ... added to EXTRA_DIST
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
2003-07-20 15:50:14 +00:00
Jody Goldberg
b42280f708 fix cut-n-paste-o
2003-07-16  Jody Goldberg <jody@gnome.org>

	* gdk/x11/gdkwindow-x11.c (gdk_window_focus) : fix cut-n-paste-o
2003-07-18 17:42:17 +00:00
Matthias Clasen
a0829aa499 API doc updates. 2003-07-14 22:13:33 +00:00
Owen Taylor
50da0ae808 gdk/x11/gdkevents-x11.c (get_real_window) gdk/x11/gdkinput-x11.c
Tue Jul  8 20:11:04 2003  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkevents-x11.c (get_real_window)
        gdk/x11/gdkinput-x11.c (_gdk_input_common_init)
        gdk/x11/gdkimage-x11.c (_gdk_windowing_image_init)
        gdk/x11/gdkprivate-x11.h (_gdk_windowing_image_init)
        Don't assume that all events start with XEventAny - Xkb events
        don't! (#105745). So, only do that for core events, and for
        non-core events, add a system for registering event types
        that start with XEventAny.

        * gdk/x11/gdkevents-x11.c (gdk_event_translate):
        Check to see if the result of gdk_window_lookup_for_display()
        is actually a window.
2003-07-11 19:57:01 +00:00
Morten Welinder
469f6e87a5 Fix memory access error. (#69436)
2003-07-11  Morten Welinder  <terra@gnome.org>

	* gdk/x11/gdkcursor-x11.c (gdk_cursor_new_from_pixbuf): Fix memory
	access error.  (#69436)
2003-07-11 17:32:49 +00:00
Kristian Rietveld
8aafd6bb16 Merge from stable.
Wed Jul  9 19:48:26 2003  Kristian Rietveld  <kris@gtk.org>

	Merge from stable.

	* gdk/gdkdisplay.c (gdk_display_get_window_at_pointer): don't
	directly return from ->window_at_pointer, but set win_x and win_y
	first if needed. (Fixes #110166, reported by Arno Charlet).

	* gdk/gdkwindow.c (gdk_window_get_composite_drawable): change
	function to accept GdkDrawables and not just GdkWindows. This was
	already done in some other functions a while back, but this patch
	got lost for some reason.
2003-07-09 18:00:21 +00:00
Kristian Rietveld
b960ba4f02 dear cvs, please SHUT UP love, -kris
dear cvs,
  please SHUT UP
love,
  -kris
2003-07-09 17:57:51 +00:00
Owen Taylor
8500d9458e Change _gdk_x11_send_xevent_async() to
Tue Jul  8 17:36:21 2003  Owen Taylor  <otaylor@redhat.com>

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

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

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

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

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

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

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

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

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

        * tests/testdnd.c (target_drag_motion): Make the trashcan
        open again. (Got lost in deprecation cleanup.)
2003-07-05 15:02:35 +00:00
Owen Taylor
e5561940f2 Move the grabs up earlier, so we don't get a big pile of uncompressed
Sat Jul  5 00:49:32 2003  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkdnd.c (gtk_drag_begin): Move the grabs up
        earlier, so we don't get a big pile of uncompressed
        motion events before the grab takes effect.

        * gtk/gtkdnd.c (gtk_drag_update_icon): Call
        gdk_window_process_all_updates() so that the area
        we are dragging over gets a change to redraw.

        * gtk/gtkdnd.c (_gtk_drag_dest_handle_event): Use
        gdk_window_get_position(), not gdk_window_get_origin().

        * gdk/x11/gdkwindow-x11.[ch] (gdk_window_have_shape_ext)
        gdkdisplay-x11.h: use XShapeQueryExtension to
        avoid duplicate XQueryExtension when we actually
        use it. Remove unnecessary caching in GdkDisplayX11.
2003-07-05 05:27:11 +00:00
Owen Taylor
58a7f9f72a Function to get a range of information about all the children of a window
Fri Jul  4 23:49:22 2003  Owen Taylor  <otaylor@redhat.com>

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

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

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

        * gdk/x11/gdkdnd-x11.c (xdnd_send_xevent): Short-circuit
        messages to the same process, use _gdk_send_xevent_async().
2003-07-05 03:02:21 +00:00
Owen Taylor
8625065817 Split toplevel-specific pieces of GdkWindowImplX11 into a separate
Fri Jul  4 22:26:27 2003  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkwindow-x11.[ch] gdkevents-x11.c: Split
        toplevel-specific pieces of GdkWindowImplX11 into
        a separate GdkToplevelX11 structure.
2003-07-05 02:34:52 +00:00
Owen Taylor
bce0622bd6 Fix some leftover fields.
Fri Jul  4 22:05:09 2003  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkasync.c (struct _SetInputFocusState): Fix
        some leftover fields.
2003-07-05 02:06:04 +00:00
Owen Taylor
9bedbf662d Use asynchronously _gdk_x11_set_input_focus_safe to avoid having to trap
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.
2003-07-05 01:54:05 +00:00
Tor Lillqvist
aac21b6f6a We can calculate the width and height of the bounding rectangle only after
2003-07-04  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_polygon,
	gdk_win32_draw_segments, gdk_win32_draw_lines): We can calculate
	the width and height of the bounding rectangle only after the
	minumum x and y have been found, and need a separate loop for
	it. Thanks to Bruce Hochstetler for providing a sample program
	exhibiting the bug.
2003-07-04 00:23:03 +00:00
Tor Lillqvist
7b08cb1796 Add gdk_string_to_compound_text_for_display. (#116537, Peter Zelezny)
2003-07-03  Tor Lillqvist  <tml@iki.fi>

	* gdk/gdk.def: Add gdk_string_to_compound_text_for_display.
	(#116537, Peter Zelezny)
2003-07-03 23:16:44 +00:00
Owen Taylor
a72aed4ea2 Implement a loader for named themed icon based on from gnome-desktop
Wed Jul  2 18:00:56 2003  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkicontheme.[ch]: Implement a loader for
        named themed icon based on from gnome-desktop library
        by Alex Larsson.

        * gtk/gtkiconthemeparser.[ch]: .ini file parsing code
        from gnome-desktop.

        * gtk/gtkiconfactory.[ch]: Add
        gtk_icon_source_set/get_icon_name() to allow stock icons
        to be based off of named theme icons.

        * gtk/gtkiconfactory.c: Rework sources so that the source
        is *either* a pixbuf, or a filename, or an icon name,
        instead of the pixbuf/filename mix it was before. Put a
        workaround for get_pixbuf() so that it can return the
        filename pixbuf, e.g, for render_icon().

        * gtk/gtkiconfactory.c: Make the default setup use
        themed icons, and add builtin icons to the default
        icon theme for all the standard pixbufs, so we
        don't rely on actually having an icon theme on disk.

        * gtk/gtkrc.c: Add support for @"icon-name" to specify
        a themed icon for a stock icon source.

        * tests/Makefile.am test/testicontheme.c: Add a test
        program from gnome-desktop.

        * gdk/x11/gdkevents-x11.c gtk/gtksettings.c: Add
        Net/IconThemeName / gtk-icon-theme-name setting.

        * gtk/gtkiconfactory.c (ensure_cache_up_to_date): Actually
        update the icon cache serial so we don't continually

        * gtk/gtkwidget.c: Fix a couple of references in doc comments
        to ::direction_set that should have been to ::direction-changed
2003-07-02 22:44:09 +00:00
Tor Lillqvist
f976beaf41 WindowFromPoint() wants screen coordinates (#115422, Tim Evans).
2003-07-01  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkwindow-win32.c (_gdk_windowing_window_get_pointer):
	WindowFromPoint() wants screen coordinates (#115422, Tim Evans).
2003-07-01 11:14:46 +00:00
Matthias Clasen
eb7135adb5 Check for Xcursor.
2003-07-01  Matthias Clasen  <maclas@gmx.de>

	* configure.in: Check for Xcursor.

	* gdk/x11/gdkcursor-x11.c:
	* gdk/gdkdisplay.h:
	* gdk/gdkcursor.h: RGBA cursor support based on Xcursor. New functions:
	gdk_cursor_new_from_pixbuf(), gdk_display_supports_cursor_alpha(),
	gdk_display_supports_cursor_color(), gdk_display_get_default_cursor_size() and
	gdk_display_get_maximal_cursor_size().  (#69436)
2003-06-30 22:30:54 +00:00
Tor Lillqvist
33902a67f0 New function, callback proc for EnumWindows().
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.
2003-06-30 21:58:24 +00:00
Tor Lillqvist
323bcc614d Fix for #111028, thanks to J. Ali Harlow, who writes: I found that the
2003-06-28  Tor Lillqvist  <tml@iki.fi>

	Fix for #111028, thanks to J. Ali Harlow, who writes:
	I found that the GdkPixmap->GdkImage reference really isn't
	important. It's only really there to have somewhere convenient to
	store the location of the pixel data in the pixmap and as an easy
	way of accessing the dimensions of that data. I have therefore put
	together a fix which removes this reference entirely which seems
	to solve the problem.

	* gdk/win32/gdkpixmap-win32.h (struct _GdkPixmapImplWin32):
	Instead of a pointer to a GdkImage, keep a pointer to the pixels
	directly.

	* gdk/win32/gdkimage-win32.c (_gdk_win32_setup_pixmap_image): Remove.
	(_gdk_win32_new_image): New function, replacing the above. Creates
	a GdkImage without any associated GdkPixmap.
	(gdk_image_new_bitmap, _gdk_image_new_for_depth): Use it instead.

	* gdk/win32/gdkprivate-win32.h: Remove from here, too.

	* gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap)
	* gdk/win32/gdkdrawable-win32.c (blit_from_pixmap)
	* gdk/win32/gdkgc-win32.c (_gdk_win32_bitmap_to_hrgn)
	* gdk/win32/gdkmain-win32.c (_gdk_win32_drawable_description):
	* gdk/win32/gdkpixmap-win32.c (gdk_pixmap_impl_win32_finalize,
	gdk_pixmap_new, gdk_bitmap_create_from_data, gdk_pixmap_foreign_new)
	Corresponding changes.
2003-06-28 01:12:51 +00:00
Tor Lillqvist
25359a2a06 When emulating X11's automatic grab on button down, pass owner_events as
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.
2003-06-22 00:21:03 +00:00
Owen Taylor
85d8c33706 Use application/x-rootwindow-drop for root window drops. (#108670, Alex
Sun Jun  8 22:03:09 2003  Owen Taylor  <otaylor@redhat.com>

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

        * gdk/x11/gdkdnd-x11.c (gdk_drag_motion) gtk/gtkdnd.c (gtk_drag_drop):
        Accept either application/x-rootwin-drop (what GTK+ has always used)
        or application/x-rootwindow-drop (what the XDND standard specifies).
2003-06-09 02:13:42 +00:00
Owen Taylor
075958ac88 Before delivering an event to a widget, check that (if relevant), the
Fri Jun  6 11:07:33 2003  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkwidget.c (event_window_still_viewable):
        Before delivering an event to a widget, check that
        (if relevant), the event's window is still viewable.
        (#105642, Dennis Björklund)

        * gdk/gdkwindow.c (_gdk_window_destroy_hierarchy):
        NULL out private->parent, since after destruction
        it might not be valid any more.

        * gdk/gdkwindow.c (gdk_window_is_viewable): Fix some
        accesses before g_return_val_if_fail(). Treat
        DESTROYED windows as unmapped.
2003-06-09 01:55:01 +00:00
Soeren Sandmann
d94c09a118 swap G and B. Fixes (#114669)
Sun Jun  8 18:27:14 2003  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gdk/gdkpixbuf-drawable.c (G8fromRGB565): swap G and B.
	Fixes (#114669)
2003-06-08 16:15:16 +00:00
Tor Lillqvist
f91ae98003 Fix typo.
2003-06-06  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkprivate-win32.h: Fix typo.
2003-06-06 23:06:29 +00:00
Tor Lillqvist
37ccf562d7 Set graphics_exposures and subwindow_mode, too, even if they aren't
2003-06-06  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkgc-win32.c (_gdk_win32_gc_new): Set
	graphics_exposures and subwindow_mode, too, even if they aren't
	currently used.
2003-06-06 22:55:55 +00:00