Commit Graph

632 Commits

Author SHA1 Message Date
Hans Breuer
a7394dc887 Implement GdkDrawableImplWin32::draw_pixbuf 2009-07-26 19:14:08 +02:00
Hans Breuer
45344cdf7c Use G_DEFINE_TYPE (GdkDrawableImplWin32, ...) 2009-07-26 19:14:07 +02:00
Hans Breuer
c5c87a918f Some cursor work for csw(win32), more left to do 2009-07-26 19:14:06 +02:00
Hans Breuer
4d2c165b75 Formatting and removing commented/obsolete code 2009-07-26 19:14:04 +02:00
Alexander Larsson
aa8693f2cb Track viewable for GdkWindow 2009-07-18 23:11:54 +02:00
Hans Breuer
f3668e96e7 Bug #588398 - Leak with testgtk::preview_(color|gray) and more
Revert to gdk_win32_ref_cairo_surface() implementation from gtk-2-16
and make _gdk_windowing_create_cairo_surface() simply delegate to it.
2009-07-18 13:13:13 +02:00
Hans Breuer
d0cf137ed9 More efficient version of _gdk_win32_window_queue_translation()
Don't create create an extraneous expose event for any scroll operation
that gtk+ does. Thanks to Alex for the hint.
2009-07-17 17:26:48 +02:00
Hans Breuer
e7737dbd19 Implement _gdk_win32_window_destroy() and more cleanup
Implement _gdk_win32_window_destroy() by just renaming
_gdk_windowing_window_destroy(), removed superfuous stub.

Also cleaned up implementations of  gdk_win32_window_set_background()
and gdk_win32_window_set_back_pixmap() - removed stuff now done at the
respective gdk_window_*() function.
2009-07-13 09:45:07 +02:00
Hans Breuer
e96c161643 Implement _gdk_win32_window_queue_translation() 2009-07-13 09:45:06 +02:00
Hans Breuer
b72960f12d Bug #588388 - shape rendering is back
Just mapping exisiting implementations to new GdkWindow API.

http://bugzilla.gnome.org/show_bug.cgi?id=588388
2009-07-13 09:45:05 +02:00
Hans Breuer
c99b4e775b Bug #588379 - testgtk::panes does not change the cursor on mouse over
That one was easy, just removing Alex's #ifdef TODO_CSW ;)

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

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

Also added some more more TODO_CSW and disabled print_event(): it can not
cope with the new _gdk_windowing_got_event() eating/morphing events.
2009-07-13 09:45:02 +02:00
Hans Breuer
b97ccecd5d Update msvc build 2009-07-13 09:45:00 +02:00
Hans Breuer
7e116727d7 Fix condition to deliver root coords 2009-07-04 12:19:12 +02:00
Hans Breuer
23b1b350b0 Enable window creation with GDK_WINDOW_CHILD again 2009-07-04 12:19:11 +02:00
Hans Breuer
1bc0954495 Initialize 'private' before use 2009-07-04 12:19:10 +02:00
Hans Breuer
bbd62f4ad8 Conditionally define WS_EX_COMPOSITED 2009-07-04 12:19:04 +02:00
Alexander Larsson
2e3866b5b2 Make GdkDrawable draw_drawable backwards compat
Turns out pygtk build broke due to the argument addition to draw_drawable.
So, we now add a new vfunc for the new draw_drawable and are thus
backwards compat.
2009-07-01 19:50:49 +02:00
Alexander Larsson
038398d493 Move new draw_drawable argument to end to make it more backwards compat 2009-07-01 16:13:31 +02:00
Alexander Larsson
681c3c288b Remove debug spew, add TODO_CSW 2009-07-01 13:33:45 +02:00
Alexander Larsson
199582aed3 gdk_win32_blit, don't get the size of the impl 2009-07-01 13:33:06 +02:00
Alexander Larsson
b1df568239 Some win32 cleanups 2009-07-01 12:06:57 +02:00
Alexander Larsson
593d5441d4 Fix win32 GC set_region handling of reset_region 2009-07-01 12:06:04 +02:00
Alexander Larsson
5341efd4d4 Make win32 backend build and minimally work 2009-07-01 10:28:06 +02:00
Alexander Larsson
0b586a5ad7 Add support for client side graphics exposures in gdk_draw_drawable 2009-05-27 17:10:32 +02:00
Alexander Larsson
7698daf97a Merge branch 'master' into client-side-windows
Conflicts:
	gdk/x11/gdkwindow-x11.c
2009-05-25 14:30:01 +02:00
Behdad Esfahbod
a398c840be Add git.mk to generate .gitignore files
Add four new doc templates that were not in repository.
2009-05-04 14:29:21 -04:00
Tor Lillqvist
c338228a86 Bug 578094 - ProcessIdToSessionId needs to be declared as WINAPI
Patch by  Shixin Zeng.
2009-04-06 15:10:35 +03:00
Cody Russell
1288ef1707 Grab changes 2009-04-02 10:16:30 +02:00
Cody Russell
f4331caf83 grabs 2009-04-02 10:16:30 +02:00
Cody Russell
49a0ec6e95 Updates 2009-04-02 10:16:30 +02:00
Cody Russell
08961c4def Get width/height from GetSystemMetrics() 2009-04-02 10:16:30 +02:00
Cody Russell
3fdd1333b2 Misc stuff 2009-04-02 10:16:29 +02:00
Cody Russell
a93c6cd6e1 CSW Win32 work in progress - builds but does not work yet. 2009-04-02 10:16:29 +02:00
Tor Lillqvist
c3879d400c Bug 575700 - Crash when moving a GtkWindow
2009-03-17  Tor Lillqvist  <tml@novell.com>

	Bug 575700 - Crash when moving a GtkWindow

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


svn path=/trunk/; revision=22568
2009-03-17 18:26:28 +00:00
Tor Lillqvist
e029e0014d Bug 573067 - Intra-app dnd of text behavior on Windows is wrong
2009-03-11  Tor Lillqvist  <tml@iki.fi>

	Bug 573067 - Intra-app dnd of text behavior on Windows is wrong

	* gdk/win32/gdkdnd-win32.c (local_send_motion) (gdk_drag_motion):
	The default action should be move, not copy. Tweak how the
	GdkDragAction fields in GdkDragContexts are changed. Seems to help
	the problem.

	Add more debugging printout for --gdk-debug=dnd to many functions.

	* gdk/win32/gdkmain-win32.c
	* gdk/win32/gdkprivate-win32.h: (_gdk_win32_drag_protocol_to_string)
	(_gdk_win32_drag_action_to_string): New functions for use in
	debugging printouts.


svn path=/trunk/; revision=22522
2009-03-11 14:09:13 +00:00
Tor Lillqvist
e51f525a76 Use G_DEFINE_TYPE. Some debugging printout changes. Hacking on the
2009-03-11  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkdnd-win32.c: Use G_DEFINE_TYPE. Some debugging
	printout changes. Hacking on the OLE2_DND code, which still
	doesn't work, though, and is not normally compiled.


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

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

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


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

	Bug 574794 - Can not resize shaped windows on Windows

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


svn path=/trunk/; revision=22511
2009-03-11 12:04:22 +00:00
Tor Lillqvist
b62e3113e6 Bug 571873 - Compile error with gdk/win32/gdkselection-win32.c
2009-02-16  Tor Lillqvist  <tml@novell.com>

	Bug 571873 - Compile error with gdk/win32/gdkselection-win32.c

	* gdk/win32/gdkselection-win32.c (gdk_selection_convert): Cast
	gpointer to char * before pointer arithmetic to avoid compilation
	error with MSVC.

	(_gdk_selection_property_delete): Remove unused variable.


svn path=/trunk/; revision=22337
2009-02-15 22:51:56 +00:00
Cody Russell
f1ed4f7347 Add potentially missing #defines for XBUTTON1, etc. Fixes the build that
2009-02-09  Cody Russell  <bratsche@gnome.org>

        * gdk/win32/gdkwin32.h:	Add potentially	missing	#defines for
        XBUTTON1, etc.  Fixes the build that was broken in r21746.


svn path=/trunk/; revision=22297
2009-02-09 13:16:14 +00:00
Tor Lillqvist
3f4c73d0d5 Bug 559408 - Transparency lost when images are copied between GTK+ and the
2009-01-29  Tor Lillqvist  <tml@novell.com>

	Bug 559408 - Transparency lost when images are copied between GTK+
	and the clipboard on Windows

	The code in gdkselection-win32.c is simplified quite a lot. When
	an image is stored on the clipboard from GTK+, only the "PNG" and
	CF_DIB formats are advertised. PNG is our preferred format because
	it can losslessly represent any image that gdk-pixbuf can handle,
	even with alpha, unambiguously. CF_DIB is also advertised because
	of its ubiquitous support in Windows software.

	Delayed rendering is used as before, so for other data than text
	nothing is actually stored on the clipboard until some app asks
	for it.

	It's pointless to advertise images formats like "image/png" or
	"image/x-MS-bmp" that no other Windows application is going to
	look for anyway. Likewise it's pointless to store text under
	formats like "text/plain" or "UTF8_STRING". Just store
	CF_UNICODETEXT. CF_TEXT will be available as a synthesized format
	anyways.

	Office 2007 offers and asks for images in PNG format using the
	registered clipboard format name "PNG", so we do likewise. If the
	"PNG" format is available that is preferred when copying to GTK+
	from the clipboard.

	Unfortunately Word 2007 still uses CF_DIB without handling
	alpha. But PowerPoint 2007 uses PNG if available and handles alpha
	correctly. Both Word and Powerpoint offer PNG with alpha nicely.

	Firefox and IE7 offer images that contain alpha as 32-bit version
	3 BI_RGB DIBs with the undocumented "extra" bytes actually being
	alpha. Also, alpha is premultiplied into the RGB bytes, presumably
	because that is how AlphaBlend() wants such DIBs. That is also
	taken care of. At least for Firefox it easy to be sure that a
	CF_DIB on the clipboard is from Firefox.

	Also some general stylistic cleanup, comment improvements, and
	improvements of debugging printout especially in the clipboard
	handling. Those are not detailled below.

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkglobals-win32.c
	* gdk/win32/gdkgmain-win32.c: Move some globals that were used
	only in gdkselection-win32.c to be local to that file.

	* gdk/win32/gdkproperty-win32.c (gdk_property_change): Don't
	bother checking if text to be placed on the clipboard consists of
	only ASCII.

	* gdk/win32/gdkselection-win32.c: Add static variables for a list
	of GdkPixbuf-supported formats, well-known registered clipboard
	formats for images, and for GdkAtoms for well-known image and text
	formats.

	(_gdk_win32_selection_init): Initialize above static variables.

	(selection_property_store) (gdk_selection_property_get)
	(_gdk_selection_property_delete): Don't use a FIFO of GdkSelProps
	for a window after all, it breaks testtext. See bug #163844.

	(gdk_selection_convert): When converting to the TARGETS format,
	i.e. when the caller wants to know what clipboard formats are
	available, if PNG is available we report just that and skip
	CF_DIB, JPEG and GIF even if advertised.

	If CF_UNICODETEXT is available, report only UTF8_STRING.

	When converting to the UTF8_STRING format, i.e. when the caller
	wants text from the clipboard, try just CF_UNICODETEXT. There is
	no point in trying CF_TEXT as Windows will synthesize
	CF_UNICODETEXT from CF_TEXT anyway, if some app has stored just
	CF_TEXT.

	When converting to the image/bmp format, i.e. when the caller
	wants an CF_DIB image from the clipboard, we check if the DIB is a
	version 3 32-bit BI_RGB one that is likely to actually contain
	alpha in the "extra" bytes. Such a DIB is likely to have
	premultiplied alpha even, at least in the case of Firefox 3 and
	IE7. We then edit the DIB in-place into a version 5 one in
	BI_BITFIELDS format and undo the alpha premultiplication.

	In any case, prepend a BMP file header before letting go of the
	data which will be fed to the gdk-pixbuf bmp loader by upper
	levels.

	(gdk_win32_selection_add_targets): If some kind of pixmap image
	format is being added, actually advertise just PNG and
	CF_DIB. Note that alpha won't be stored on the clipboard through
	CF_DIB. This is because gdk-pixbuf's bmp loader doesn't save
	alpha. Furthermore, few if any non-GTK+ Windows apps seem to
	understand a version 5 DIB with proper alpha anyway.

	(_gdk_win32_selection_convert_to_dib): Simplified muchly.



svn path=/trunk/; revision=22255
2009-01-30 01:16:47 +00:00
Tor Lillqvist
1948867311 Rename static local functions and variables to not have any unnecessary _
2009-01-21  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkcursor-win32.c: Rename static local functions and
	variables to not have any unnecessary _ or _gdk_win32 prefix.

	* gdk/win32/gdkcursor-win32.c (hcursor_from_type): Implement
	creating a GDK_BLANK_CURSOR.


svn path=/trunk/; revision=22165
2009-01-21 20:51:22 +00:00
Tor Lillqvist
bb56a0a119 Bug 523554 - Copy from GIMP to Word broken
2009-01-11  Tor Lillqvist  <tml@iki.fi>

	Bug 523554 - Copy from GIMP to Word broken

	* gdk/win32/gdkselection-win32.c
	(_gdk_win32_selection_convert_to_dib): The DIB stored in the
	Windows Clipboard was for some unknown reason truncated by one
	byte. Don't do that.


svn path=/trunk/; revision=22086
2009-01-11 13:23:46 +00:00
Tor Lillqvist
7ddb955766 Bug 566628 - gdk_display_close always asserts on win32
2009-01-05  Tor Lillqvist  <tml@novell.com>

	Bug 566628 - gdk_display_close always asserts on win32

	* gdk/win32/gdkdisplay-win32.c
	(_gdk_windowing_set_default_display): Allow also a NULL parameter
	in the g_assert(). Still don't actually do anything in this
	function, though.


svn path=/trunk/; revision=22068
2009-01-05 15:31:14 +00:00
Tor Lillqvist
74aeac9e66 Bug 557212 - Problem with which window gains focus and is visible
2008-11-04  Tor Lillqvist  <tml@novell.com>

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

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

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


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

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

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

	(print_event): Print more information for GDK_CLIENT_EVENT events.

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


svn path=/trunk/; revision=21748
2008-11-01 11:55:16 +00:00
Tor Lillqvist
c103cbec8a Bug 557266 - Window Management Problem
2008-10-21  Tor Lillqvist  <tml@novell.com>

	Bug 557266 - Window Management Problem

	Also reported in mail to gtk-list, and of course it has been well
	known in general that window state management is messy and buggy
	in various ways in gdk/win32.

	* gdk/win32/gdkwindow-win32.c (show_window_internal): Correct
	handling of GDK_WINDOW_STATE_ABOVE windows. It doesn't work to set
	the WS_EX_TOPMOST extended style bit using SetWindowLong(). We
	must call SetWindowPos() on the window using HWND_TOPMOST
	instead. The description for WS_EX_TOPMOST in the documentation
	for CreateWindowEx() even implies that if you read it carefully.


svn path=/trunk/; revision=21694
2008-10-21 20:31:05 +00:00
Tor Lillqvist
a7dd74740a On WM_WINDOWPOSCHANGING, don't dereference windowpos in the debugging
2008-10-18  Tor Lillqvist  <tml@novell.com>

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

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

	Bug 556578 - GIMP windows stay on top of other windows

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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


svn path=/trunk/; revision=21587
2008-10-05 00:00:10 +00:00