Commit Graph

92 Commits

Author SHA1 Message Date
Руслан Ижбулатов
026cb53875 win32: Port to new monitor api 2016-04-27 23:18:16 -04:00
Ignacio Casal Quinteiro
c9add3161f win32: add missing empty lines 2016-04-11 22:25:41 +02: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
8f25481406 win32: use a struct for the event source
This removes the event_poll_fd global variable and the (ab)use of
get_default_display. It is also more consistent with other backends.

Also store display
2016-03-05 20:31:10 +01:00
Paolo Borelli
4a6f8a065a gdk: remove the display->list_devices vfunc
gdk_display_list_devices is deprecated and all the backends
implement the same fallback by delegating to the device manager
and caching the list (caching it is needed since the method does
not transfer ownership of the container).
The compat code can be shared among all backends and we can
initialize the list lazily only in the case someone calls the
deprecated method.

https://bugzilla.gnome.org/show_bug.cgi?id=762891
2016-02-29 21:53:58 +01:00
Paolo Borelli
33ac51ea72 win32: init wintab when the device manager is constructed
No need to call a method explicitely after creating the object
2016-02-29 18:25:01 +01:00
Paolo Borelli
e9d2a622e2 win32: actually call _gdk_win32_screen_on_displaychange_event
41a371c435 factored out a method
but I forgot to actually amend the commit to call the new function
2016-02-29 18:25:01 +01:00
Paolo Borelli
38ad57948c gdk: remove the core_pointer field from GdkDisplay
It is not used anymore, so no need to set it

https://bugzilla.gnome.org/show_bug.cgi?id=762820
2016-02-29 14:15:04 +01:00
Paolo Borelli
aaed73671c win32: close the screen when disposing the display 2016-02-28 15:53:52 +01:00
Paolo Borelli
41a371c435 win32: factor out on_displaychange_event method for the screen
This allows us to make more initialization methods private to the
screen object.
2016-02-28 12:19:08 +01:00
Paolo Borelli
48d693ea80 win32: make init_root_window private to the screen object
It can be called during the screen object initilization
2016-02-28 12:18:58 +01:00
Paolo Borelli
00f396dea9 win32: rename initialization function for clarity 2016-02-28 11:50:07 +01:00
Paolo Borelli
e48bd2e00b win32: move gdkvisual code in gdkscreen
Except for the init function, all the visual related code is made
of gdkscreen vfuncs, so let's move it to gdkscreen-win32. This way
we avoid keeping other static variables and instead store the info
inside the screen struct.
2016-02-28 11:37:38 +01:00
Paolo Borelli
c643d8b402 Win32: fix warning 2016-02-22 21:45:08 +01:00
Paolo Borelli
7047099fd8 Win32: fold the gdkinput.c file in gdkdisplay-win32.c
This is similar to what is done in the X11 and wayland backends.
It also gets rid of the _gdk_input_devices global variable
2016-02-22 21:45:08 +01:00
Paolo Borelli
577016126e Win32: remove the _gdk_monitors global variable
Make it a field of GdkWin32Screen since that is the object exposing
all the the getters.
2016-02-19 15:28:38 +01:00
Ignacio Casal Quinteiro
f6cc3be118 win32: get rid of _gdk_screen global variable
The screen is part of the display so it should be belong to it.
2016-01-15 12:35:31 +01:00
Paolo Borelli
3cd79c11fc win32: remove _gdk_root global variable 2016-01-14 14:30:37 +01:00
Paolo Borelli
8c355d8fe6 Win32: call dnd exit when finalizing the display
Since we init dnd when opening the display, call the corresponding
exit function (which is unused at the moment) when finalizing the
display.
2015-12-17 17:18:02 +01:00
Ignacio Casal Quinteiro
d74a08b80f win32: do not use g_clear_pointer also on the clipboard window
A follow up on the previous patch. We should use DestroyWindow
directly since it has a different calling convention than
the expected callback for g_clear_pointer
2015-11-13 12:58:45 +01:00
Ignacio Casal Quinteiro
2ad243d43d win32: do not use g_clear_pointer to destroy the window
DestroyWindow expects a different calling convenction so
we endup getting an error at runtime
2015-11-13 12:57:53 +01:00
Ignacio Casal Quinteiro
1f5f3ca41b win32: destroy clipboard notification window on dispose
The clipboard uses a hidden window to get some specific events.
The window was created but never destroyed on dispose.
2015-11-12 17:09:25 +01:00
Ignacio Casal Quinteiro
79f7f19c6e win32: chain up on display dispose 2015-11-12 16:00:53 +01:00
Paolo Borelli
8606e57910 win32: handle WM_DISPLAYCHANGE globally
Instead of handling WM_DISPLAYCHANGE on every GdkWindow, only handle
it on an ad-hoc hidden window we create when opening the display.
This has two reasons:
1) we want emit the display::size-changed signal even if there are no
   gtk windows currently open
2) we want to emit the signal just once and not once for every window

https://bugzilla.gnome.org/show_bug.cgi?id=757324
2015-10-31 15:31:11 +01:00
Matthias Clasen
f703ea6599 win32: Fix introspection syntax 2015-10-22 11:50:49 -04:00
Ignacio Casal Quinteiro
342b620223 win32: use the same type as the prototype 2015-10-16 09:07:32 +02:00
Ignacio Casal Quinteiro
22b0ed6807 win32: use the same parameter name as the implementation 2015-10-08 18:07:49 +02:00
Руслан Ижбулатов
26c24328d5 GDK: Add cursor theme support to W32 backend
Load themed cursors from the same places they are loaded on freedesktop systems,
but use W32 API functions to do so (works for .cur/.ani cursors instead of X
cursors).

Refactor the code for cursor handling. Prefer loading cursors by name.

Do not load actual cursors when loading the theme. Find the files and remember
the arguments/calls for loading them instead. Keeping HCURSOR instance in the
hashmap would result in multiple GdkCursors using the same HCURSOR. Given that
we use DestroyCursor() to off them, this would cause problems (at the very
least - DestroyCursor() would fail).

Store GdkCursor instances in a cache. Update cached cursors when theme changes.

Recognize "system" theme as a special (and default) case. When it is set,
prefer system cursors and fall back to Adwaita cursors and (as a last resort)
built-in X cursors. Otherwise prefer theme cursors and fall back to system and
X cursors.

Force GTK to use "left_ptr" cursor when no cursor is set. Using NULL makes
it use the system default "arrow", which is not the intended behaviour when
a non-system theme is selected.

Ignore cursor size setting and query the OS for the required cursor size, as
Windows (almost) does not allow setting cursors of arbitrary size.

https://bugzilla.gnome.org/show_bug.cgi?id=749287
2015-05-20 08:42:24 +00:00
Руслан Ижбулатов
cd54a54346 GDK-W32: remove trailing whitespace everywhere 2015-04-29 21:12:14 +00:00
Jose Rostagno
7a6aee1db4 HAVE_MONITOR_INFO is always defined
https://bugzilla.gnome.org/show_bug.cgi?id=748156
2015-04-27 06:40:43 -04:00
Jose Rostagno
dcd5368252 WM_CLIPBOARDUPDATE is always define on vista+
https://msdn.microsoft.com/en-us/library/windows/desktop/ms649021%28v=vs.85%29.aspx

https://bugzilla.gnome.org/show_bug.cgi?id=748156
2015-04-27 06:40:43 -04:00
Matthias Clasen
6ccef21d49 Fix a typo
Follow-up fix for commit 7cee6c5cc6.
2015-02-27 17:00:08 -05:00
Emmanuele Bassi
7cee6c5cc6 gdk: Use a better error message
Having "Assertion failed: success" on the console is not going to help
anyone.
2015-02-27 21:02:16 +00:00
Chun-wei Fan
536fa88cd8 Add OpenGL Support for the GDK Windows Backend
This adds support for OpenGL to the GDK Windows backend using the WGL API
calls, which enables programs that uses the GTK+ GLArea widgets to work on
Windows as well.

This also adds a simple utility function to query for the version of OpenGL
that is supported by the Windows system, like the one provided by the X11
backend.

Many thanks to Alex (and Emmanuele, who started the OpenGL integration in
GTK+) who offered advice and help along the way, as well as the X11 and
Wayland backend for this work to refer to and to model upon.

https://bugzilla.gnome.org/show_bug.cgi?id=740795
2014-12-17 16:07:02 +08:00
Jasper St. Pierre
887b7356c3 gdkdisplay: Provide a default event_data_copy / event_data_free
Every single implementation but Quartz is a no-op for this, so just
provide it once rather than in every backend.
2014-10-27 22:13:23 -07:00
Vasiliy Nuzha
ba6522d3f2 Fix monitors enumeration bug
Fix monitors enumeration bug. By default used MONITORINFOEXW (UTF-16 Build) with wrong structure size
2014-10-06 22:48:08 +00:00
Руслан Ижбулатов
1b9fa975af Fix some print format warnings
https://bugzilla.gnome.org/show_bug.cgi?id=734736
2014-08-13 23:40:59 +00:00
Руслан Ижбулатов
a23c29c0fb W32: Implement rudimentary WM_NCHITTEST handling
Use (cairo) input shape of the window to check whether a point is inside or not
inside the window.
If it is, let the default window procedure do its thing (which seems to be
working all right in all known cases).
If it isn't, override the default window procedure and tell WM what we think.

Don't do any of the above if the window has CSD-incompatible styles (WS_BORDER
or WS_THICKFRAME).

This is a crude kind of substitute for window input shape support (which W32
does not seem to have). Still probably enough to be positive about input shapes
support.

https://bugzilla.gnome.org/show_bug.cgi?id=733679
2014-07-29 01:31:49 +00:00
Chun-wei Fan
0e01f9cc9c GDK/GTK on Windows: Fix build
Due to the work on gdk_cursor_new_from_surface (commit b2113b73),
get_cursor_for_pixbuf() in GdkDisplayClass was converted to
get_cursor_for_surface(), which means the GDK Win32 backend needs to be
updated for the code to build and run on Windows, plus some function
prototypes and declarations/calls need to be updated as well.

https://bugzilla.gnome.org/show_bug.cgi?id=705980
2013-08-26 10:29:23 +08:00
Alexander Larsson
995a7e95b9 win32: Remove unused functions
The _gdk_windowing_* stuff is not used anymore
2013-07-03 12:27:10 +02:00
Руслан Ижбулатов
b0016252cf Pass screen to visual init (no default screen is available yet)
https://bugzilla.gnome.org/show_bug.cgi?id=700444
2013-06-11 11:16:04 +02:00
Benjamin Otte
8762791e82 win32: Call windowing init from display_class_init()
This follows the same reasoning as the X11 backend in commit
0122a9da8e
2013-05-02 15:36:41 +02:00
Benjamin Otte
f345051d36 displaymanager: Emit display-opened directly
Instead of letting every backend do it manually.
2013-04-19 16:18:25 -04:00
Benjamin Otte
4a6ba8b253 win32: Emit GdkDisplay::opened signal 2013-04-19 16:18:25 -04:00
Alexander Larsson
781ad5a1bc win32: Make build with latest gdkdisplay changes 2013-04-11 11:25:25 +02:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Alexander Larsson
52be8cb9e9 win32: Fix some warnings 2011-11-10 17:41:11 +01:00
Alexander Larsson
a1828e8b60 win32: Make flush/sync work like in X
gdk_flush() should gdk_display_sync() on all open displays.

Both for display_flush and display_sync it seems useful to call
GdiFlush, but we don't have anything extra to do for display_sync,
as there is no inherent roundtrip on win32.

This should close bug #84314
2011-11-10 17:41:06 +01:00
Chun-wei Fan
b18718ac7e Add G_ENABLE_DEBUG #ifdef check in gdkdisplay-win32.c
Commit 88707e6912 used
_gdk_win32_cf_to_string, which is only defined when G_ENABLE_DEBUG
is defined, so add G_ENABLE_DEBUG #ifdef around that part.
2011-11-10 17:40:49 +01:00
Marc-André Lureau
1afc29d869 win32: resurect Windows clipboard selection notification
This is a rewrite of e6fa7394ba, with
misc fixes that should help with some bugs Tim was talking about.

https://bugzilla.gnome.org/show_bug.cgi?id=652239
2011-11-10 17:40:48 +01:00