Commit Graph

88 Commits

Author SHA1 Message Date
Matthias Clasen
211d72e545 win32: Avoid a screen argument
The screen is never used in _gdk_win32_screen_get_setting,
so drop it.
2017-11-17 13:21:24 -05:00
Benjamin Otte
4c4e914806 gdk: Replace GDK_NONE with NULL 2017-11-15 19:07:17 +01:00
Matthias Clasen
e2682e62a8 win32: Remove all uses of get_root_window
This is following similar changes done in the x11 and
broadway backends, but it has not been built.
Some fixups may be needed.
2017-11-14 18:16:19 -05:00
Matthias Clasen
c1c919cf7d win32: Stop using gdk_display_get_root_window
Use the newly introduced backend api for this purpose.
2017-11-05 21:45:51 -05:00
Chun-wei Fan
6a12a3cd10 gdk/win32: Fix build after GdkScreen and cursor cleanups
Move the leftovers from the removals to use the current APIs, to fix the
build.  Also for gdk_device_virtual_set_window_cursor(), only do
something when a valid GdkCursor is passed in here.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-11-04 10:32:21 +08:00
Matthias Clasen
463fba18a6 Port to gdk_display_get_root_window
This is the replacement for the GdkScreen api of the same name.
2017-10-31 21:27:24 -04:00
Chun-wei Fan
b0dc8514e4 gdk/win32: Fix build after GdkScreen and settings changes
Implement GdkDisplay->get_setting() using the existing
_gdk_win32_screen_get_setting() and get rid of GdkScreen->get_setting()
as a result, to follow the changes in GDK.

Also, since we don't emit settings events in the Windows GDK backend,
but we acquire settings to print using GDK_SETTING, drop all references
related to GDK_SETTING since that is now removed.  Update the debug
strings that are print out as a result
(gdk_screen_get_setting->gdk_display_get_setting).

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-10-31 14:50:24 +08:00
Руслан Ижбулатов
b9b67e05e1 GDK W32: Optimize clipboard handling a bit
Delay as long as possible before calling OpenClipboard(),
call CloseClipboard() as quickly as possible after that.
Don't call OpenClipboard() when we don't need to (for example,
we don't need to open clipboard to call GetClipboardOwner()).

Also, print out actual W32 error code in some cases where it
was not printed before.

https://bugzilla.gnome.org/show_bug.cgi?id=763907
2016-03-26 00:03:50 +00:00
Paolo Borelli
3cd79c11fc win32: remove _gdk_root global variable 2016-01-14 14:30:37 +01:00
Руслан Ижбулатов
cd54a54346 GDK-W32: remove trailing whitespace everywhere 2015-04-29 21:12:14 +00:00
Руслан Ижбулатов
a0faf5a51c Fix various warnings
https://bugzilla.gnome.org/show_bug.cgi?id=734737
2014-08-13 23:41:56 +00:00
Matthias Clasen
5d7c79574b Use Adwaita on Windows too
Having the same, usable, default appearance acroll platforms
trumps having a more-or-less working native theme. The default
will be Adwaita on all platforms. The native ms-windows theme
is of course still available.
2014-06-13 16:49:59 -04:00
Marc-André Lureau
2230fea0b6 win32: add more clipboard data checks to avoid crash
It may happen that the received clipboard data is empty, but
if it's of type image/bmp, gtk+ will crash:

gdk_property_change: 00030AD4 GDK_SELECTION image/bmp REPLACE 8*0 bits:
... delayed rendering
gdk_selection_send_notify_for_display: 00030AD4 CLIPBOARD image/bmp
GDK_SELECTION (no-op)
_gdk_win32_selection_convert_to_dib: 1252003C image/bmp

Program received signal SIGSEGV, Segmentation fault.
0x749a9f40 in msvcrt!memmove () from C:\Windows\syswow64\msvcrt.dll

Thread 1 (Thread 2248.0x1b34):
target=0xc07b) at gdkselection-win32.c:1292
at gdkevents-win32.c:3498
wparam=8, lparam=0) at gdkevents-win32.c:232
message=773, wparam=8, lparam=0)
    at gdkevents-win32.c:263
C:\Windows\syswow64\user32.dll
C:\Users\rugoosse\AppData\Local\virt-viewer\bin\libpangocairo-1.0-0.dll
wparam=0, lparam=-1687549457)
    at gdkevents-win32.c:248
C:\Users\rugoosse\AppData\Local\virt-viewer\bin\libpangocairo-1.0-0.dll

https://bugzilla.gnome.org/show_bug.cgi?id=728745
2014-04-24 16:12:07 +02:00
Chun-wei Fan
9e686d1fb5 gdkproperty-win32.c: Fix gtk-font-name handling
...on Windows 8+ and when the system setting for non-Unicode programs do
not match the language version of Windows by falling back to using Pango.

This ensures that the correct font is used during these scenarios, so that
we minimize the risk of seeing garbled characters for texts that the system
code page does not support due to system peculiarties.  There might be a
way to support gtk-font-name handling using the native Windows APIs
directly on Windows 8+, but that needs to be investigated.

https://bugzilla.gnome.org/show_bug.cgi?id=726298
2014-03-28 21:06:14 +08:00
Ignacio Casal Quinteiro
e1b874b44f win32: remove useless comment since we do not support win98 anymore 2014-01-27 14:39:53 +01:00
Ignacio Casal Quinteiro
254d35af29 win32: handle again gtk-font-name
This code is ugly but it seems to do the work
2014-01-27 09:47:21 +01:00
Matthias Clasen
2fb64cf0e7 Win32: Set the shows-desktop platform setting
Win32 shows icons on the desktop, so set shows-desktop
to TRUE here.
2013-11-15 07:51:22 -05:00
Matthias Clasen
f8412eca34 Revert "Deprecate and ignore the cursor blink settings"
This reverts commit b2e666bf8f.

We need to keep cursor blinking configurable for accessibility
reasons.

https://bugzilla.gnome.org/show_bug.cgi?id=704134

Conflicts:
	gdk/win32/gdkproperty-win32.c
	gdk/x11/gdksettings.c
	gtk/gtksettings.c
	gtk/gtktextview.c
2013-08-16 22:45:13 -04:00
William Jon McCann
57fc8763e9 Deprecate and ignore the timeout-initial and timeout-repeat settings 2013-07-11 17:08:15 -04:00
William Jon McCann
7b66956e63 Deprecate and hardcode default toolbar icon size setting
Toolbar icon size can still be changed on a per-widget basis as
needed by the application developer.
2013-07-08 15:02:28 -04:00
William Jon McCann
425e977bb6 Deprecate and hardcode default toolbar style setting
Toolbar style can still be changed on a per-widget basis as
needed by the application developer.
2013-07-08 15:02:28 -04:00
William Jon McCann
85c0614707 Remove gtk-im-status-style and gtk-im-preedit-style from GDK as well 2013-06-30 13:45:43 -04:00
William Jon McCann
7ca327c9bb Deprecate the unused gtk-file-chooser-backend setting 2013-06-30 13:44:24 -04:00
William Jon McCann
e779e04bc2 Deprecate and ignore gtk-icon-sizes setting
We don't have icons rendered at arbitrary sizes and we have better
APIs that aren't restricted to GtkIconSizes.
2013-06-26 18:04:27 -04:00
William Jon McCann
3e96625411 Remove the rest of gtk-touchscreen-mode 2013-06-26 15:35:47 -04:00
William Jon McCann
b26c74e5da Deprecate and ignore gtk-menu-bar-accel setting
Use 'F10' by default.
2013-06-26 14:21:44 -04:00
William Jon McCann
aa78c888eb Deprecate and ignore gtk-fallback-icon-theme
The standard icon themes have built in fallbacks.
2013-06-26 12:47:43 -04:00
William Jon McCann
b2e666bf8f Deprecate and ignore the cursor blink settings
And hardcode them to reasonable values.
2013-06-26 12:32:31 -04:00
William Jon McCann
2d79334bb0 Deprecate and ignore gtk-can-change-accels
It is disabled by default
2013-06-26 12:00:42 -04:00
William Jon McCann
7e3a494fac Deprecate and ignore gtk-enable-mnemonics and gtk-auto-mnemonics" properties
They are both enabled by default.
2013-06-26 11:16:12 -04:00
William Jon McCann
e8147d15f7 Deprecate and ignore gtk-menu-images setting
GtkImageMenuItem images can still be enabled selectively by the app author
using the always-show-image property on the item.
2013-06-26 10:53:09 -04:00
William Jon McCann
65c31629c3 Deprecate and ignore gtk-button-images setting
Button images can still be enabled selectively by the app author
using the always-use-image property on the button.
2013-06-26 09:15:22 -04:00
William Jon McCann
1b3f9df361 Remove rest of gtk-show-input-method-menu and gtk-show-unicode-menu
They are no longer used.
2013-06-21 08:59:32 -04:00
Aleksander Morgado
136f6b15be win32: don't convert '\n' to '\r\n' when copying if it already is '\r\n'
https://bugzilla.gnome.org/show_bug.cgi?id=649390
2013-06-18 14:37:03 +02:00
Marc-André Lureau
564b4e667a win32: do not crash on invalid utf8 conversion
g_utf8_to_utf16() is not guaranteed to succeed. Check the error
and return if it failed.

https://bugzilla.gnome.org/show_bug.cgi?id=696232
2013-03-23 15:50:09 -04:00
Aleksander Morgado
399ffbb230 win32: fix possible memleak if GlobalAlloc() fails
Also remove the unused 'buf' variable.

https://bugzilla.gnome.org/show_bug.cgi?id=694742
2013-02-26 15:13:32 +01:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Hans Breuer
1d838f586c win32: gdk3 resurrection
There are sure regressions but basic stuff seems to be working
again after all the API breakage done with comments like
"Win32 and Quartz need to be ported still."
2011-01-02 13:33:04 +01:00
Bastien Nocera
7d11c16b17 gdk: Add XSetting for "gtk-cursor-blink-timeout"
Otherwise the blink timeout is the one used by default in GTK+.

https://bugzilla.gnome.org/show_bug.cgi?id=634697
2010-11-13 15:23:34 +09:00
Tor Lillqvist
eb21a7df29 Work on OLE2-based generic DND
Intermediate commit of work in progress on integrating the old code
for OLE2-based generic drag and drop from Arhaeopteryx Software, from
a long time ago in the GTK+ 1.3 timeframe. Does still not work and is
as before not compiled in unless OLE2_DND is defined in
gdkdnd-win32.c. (Thus, for inter-process DND, still only WM_DROPFILES
style dropping of files on GTK+ apps works.)

Related slight refactoring of other code that shouldn't change how it
works. Add more global variables for run-time constants (once
initialized) representing well-known GdkAtoms and registered Windows
clipboard formats, as they with the generic DND code will be needed in
several source files. Some improved debugging output.
2009-12-16 13:10:21 +02:00
Tor Lillqvist
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
a860ec7d7b Bug 544684 - Win64 issue, window handles are assumed to be 32-bit
2008-08-05  Tor Lillqvist  <tml@novell.com>

	Bug 544684 - Win64 issue, window handles are assumed to be 32-bit

	* gdk/win32/gdkproperty-win32.c
	* gdk/win32/gdkselection-win32.c: Add some guchar and char pointer
	casts to get rid of gcc 4.4 warnings. Print GdkAtom values in
	debugging output using the %p format.


svn path=/trunk/; revision=20993
2008-08-04 23:01:32 +00:00
Johan Dahlin
d97cdbdf53 Include "config.h" instead of <config.h> Command used: find -name
2008-06-21  Johan Dahlin  <jdahlin@async.com.br>

    * *.[ch]: Include "config.h" instead of <config.h>
    Command used:
    find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g'
    Rubberstamped by Mitch and Tim


svn path=/trunk/; revision=20669
2008-06-22 14:28:52 +00:00
Matthias Clasen
f8a1be3a04 Add a gtk-im-module GTK setting
2007-12-17  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtksettings.c: Add a gtk-im-module GTK setting
        * gdk/win32/gdkproperty-win32.c:
        * gdk/x11/gdksettings.c: ...and back it by a Gtk/IMModule X setting.

        * gtk/gtkimmodule.[hc]:
        * gtk/gtkimmulticontext.[hc]: When determining the default context,
        look at the gtk-im-module setting, and listen for changes to the
        setting.  (#502446, Akira Tagoh)


svn path=/trunk/; revision=19195
2007-12-18 03:24:17 +00:00
Matthias Clasen
82ce59cd0f Remove unnecessary NULL checks before g_free(). (#369666, Morten Welinder,
2007-03-09  Matthias Clasen <mclasen@redhat.com>

        * Everywhere: Remove unnecessary NULL checks before
        g_free().  (#369666, Morten Welinder, Djihed Afifi)

        * configure.in: Check for ftw.h



svn path=/trunk/; revision=17444
2007-03-09 21:57:37 +00:00
Kristian Rietveld
0677ad8e59 Support inverting arrows via XSetting. (#377979, Yevgen Muntyan).
2006-12-27  Kristian Rietveld  <kris@gtk.org>

	Support inverting arrows via XSetting. (#377979, Yevgen Muntyan).

	* gtk/gtksettings.c (gtk_settings_class_init): add new setting
	gtk-alternative-sort-arrows.

	* gdk/win32/gdkproperty-win32.c (gdk_screen_get_setting): add
	new setting.

	* modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: set new
	gtk-alternative-sort-arrows setting to true.

	* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_update_button):
	invert direction if gtk-alternative-sort-arrows is TRUE.
2006-12-27 19:52:25 +00:00
Tor Lillqvist
1ff434a681 Remove support for Windows 9x/ME. GTK+ hasn't worked on Win9x since 2.6 or
2006-08-29  Tor Lillqvist  <tml@novell.com>

	Remove support for Windows 9x/ME. GTK+ hasn't worked on Win9x
	since 2.6 or 2.8. It's pointless to keep the Win9x code in here as
	it isn't being maintained anyway. If somebody is interested, it
	can always be found in older GTK+ versions, and in CVS.

	* gdk/win32/gdkcursor-win32.c
	* gdk/win32/gdkdnd-win32.c
	* gdk/win32/gdkdrawable-win32.c
	* gdk/win32/gdkgc-win32.c
	* gdk/win32/gdkglobals-win32.c
	* gdk/win32/gdkkeys-win32.c
	* gdk/win32/gdkmain-win32.c
	* gdk/win32/gdkproperty-win32.c
	* gdk/win32/gdkselection-win32.c: Remove the G_WIN32_IS_NT_BASED()
	and G_WIN32_HAVE_WIDECHAR_API() tests and their false (Win9x)
	branches, and any variables or static functions used only by the
	Win9x branches.

	* gdk/win32/gdkprivate-win32.h: Remove backup definitions for
	constants that aren't missing from current mingw and MSVC6
	headers.

	* gdk/win32/gdkmain-win32.c
	* gdk/win32/gdkprivate-win32.h: Remove the _gdk_win32_gdi_failed()
	function. On NT-based Windows GetLastError() returns error codes
	also for failed GDI calls, so we can use _gdk_win32_api_failed()
	always.
2006-08-29 23:01:53 +00:00
Tor Lillqvist
dd9aefca76 Convert \n to \r\n also when storing CF_UNICODETEXT (UTF-16) in the
2006-06-11  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkproperty-win32.c (gdk_property_change): Convert \n
	to \r\n also when storing CF_UNICODETEXT (UTF-16) in the
	Clipboard. (#344496)
2006-06-11 19:45:56 +00:00
Tor Lillqvist
4d1b5589c5 gdk/win32/gdkprivate-win32.h gdk/win32/gdkglobals-win32.c Add more
2005-11-01  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkglobals-win32.c
	* gdk/win32/gdkmain-win32.c (_gdk_windowing_init): Add more
	pre-interned GdkAtoms and pre-registered clipboard formats. Sort
	their declarations, definitions and assignments into a more
	logical and consistent order.

	* gdk/win32/gdkmain-win32.c (_gdk_win32_cf_to_string): Include the
	CF_ prefix for the predefined clipboard format names. Put quotes
	around registered format names to distinguish them.

	* gdk/win32/gdkproperty-win32.c (gdk_property_change): Return
	immediately with a warning if the property type is STRING, TEXT,
	COMPOUND_TEXT or SAVE_TARGETS, as these are X11-specific that we
	should never pretend to handle on Win32. Handle only UTF8_STRING
	here, other formats with delayed rendering. Use \uc1 instead of
	\uc0 when generating Rich Text Format for easier testability on
	XP, where WordPad misinterprets \uc0 encoded characters. Add more
	GDK_NOTE debugging output for Clipboard operations.

	* gdk/win32/gdkselection-win32.c: Debugging printout improvements.
	(gdk_selection_convert): Don't pretent to handle STRING, just
	UTF8_STRING. Streamline error handling, don't unnecessarily have a
	GError which then isn't used for anything anyway if it gets set.
	(gdk_win32_selection_add_targets): Skip also STRING, TEXT,
	COMPOUND_TEXT and SAVE_TARGETS in addition to UTF8_STRING.
2005-11-01 15:29:59 +00:00
Hans Breuer
e5d06c7ca9 fix typo for GTK_VER; define HAVE_CONFIG_H cause gtkprogressbar.c has
2005-09-18  Hans Breuer  <hans@breuer.org>

	* gtk/makefile.msc.in : fix typo for GTK_VER; define HAVE_CONFIG_H
	cause gtkprogressbar.c has #include <config.h> conditionally; less
	noise from generated gtk.def
	* gtk/stock-icons/makefile.msc gdk/makefile.msc tests/makefile.msc : updated

	* gtk/gtktrayicon-win32.c : dummy implmentation to make gtk compile.
	For me it works as well as the *NIX implemenation, that is not at all.

	* gdk/win32/gdkproperty-win32.c : implement gdk_atom_intern_static_string()

	* gdk/win32/gdkwindow-win32.c(gdk_window_set_urgency_hint) : only use
	only use (WINVER >= 0x0500) when available from the SDK. Otherwise fall
	back to true dynamic linking of FlashWindowEx. Makes gtk+ work on NT4.0
	again - if compiled properly.

	* tests/teststatusicon.c : don't use GNOME icons for testing, but icons
	already coming with Gtk+. Makes it compile on win32.
2005-09-18 12:28:42 +00:00