Commit Graph

1028 Commits

Author SHA1 Message Date
Paolo Borelli
2e7f98a683 Win32: remove the _is_win8_or_above global variable 2016-02-19 15:28:38 +01:00
Benjamin Otte
033fb5a879 win32: Always pass a window to the default event filters
This has to happen or the event filter cannot identify what type
of display the event is from (ie if it's an XEvent, a broadway
event or a win32 MSG.
2016-02-11 03:44:48 +01:00
Benjamin Otte
ec3ce21beb win32: Remove _gdk_display usge from dnd code 2016-02-11 03:44:47 +01:00
Benjamin Otte
7f266e1a03 win32: Make cursor code work without _gdk_display 2016-02-11 03:44:47 +01:00
Benjamin Otte
76e56c5038 win32: Stop using _gdk_display global in device code
Use gdk_device_get_display() instead.
2016-02-11 03:44:47 +01:00
Benjamin Otte
766b1b9886 win32: Remove deprecation warnings in dnd code 2016-02-11 03:44:46 +01:00
Benjamin Otte
4ce6d10601 win32: Remove deprecation warnings in devicemanager code 2016-02-11 03:44:46 +01:00
Benjamin Otte
584931e94d win32: Use g_set_object()
... instead of a hand-rolled version that does the same thing.
2016-02-11 03:44:46 +01:00
Benjamin Otte
788951c543 win32: Fix empty body warning 2016-02-11 03:44:46 +01:00
Ignacio Casal Quinteiro
eb555979db win32: properly handle show and focus
The first time a window is shown we should always call SW_SHOWNORMAL.
Understand whether to call SW_SHOW or SW_SHOWNORMAL and the specific
ones for the temporary windows depending on IsWindowVisible.
This also fixes the problem when calling gtk_window_present and
the window is snapped to the left or right of the screen.

This patch is based on the patches provided by Yevgen Muntyan
and Aleksander Morgado.

https://bugzilla.gnome.org/show_bug.cgi?id=698652
2016-02-08 13:25:01 +01:00
Yevgen Muntyan
07a994c89f win32: on focus restore the window if iconified
If the window is iconified we want to restore the window
to get the proper size instead of showing it normal which
would change the size of the window.

https://bugzilla.gnome.org/show_bug.cgi?id=698652
2016-02-08 12:58:58 +01:00
Ignacio Casal Quinteiro
05f1994808 win32 geometry: reorganize code to avoid prototypes 2016-01-23 14:43:57 +01:00
Ignacio Casal Quinteiro
3bb23ef2fe win32 device manager: reorganize code to avoid prototypes 2016-01-23 14:43:55 +01:00
Ignacio Casal Quinteiro
b3eaaa5a2c win32 virtual device: reorganize code to avoid prototypes 2016-01-23 14:43:52 +01:00
Ignacio Casal Quinteiro
36c3f21989 win32 device: reorganize code to avoid prototypes 2016-01-23 14:43:50 +01:00
Ignacio Casal Quinteiro
ca4ffbfe80 wintab: reorganize code to avoid prototypes 2016-01-23 14:43:47 +01:00
Руслан Ижбулатов
f74f81f06b W32: Detect ticks wraparound
https://bugzilla.gnome.org/show_bug.cgi?id=748327
2016-01-18 09:23:44 +00: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
Ignacio Casal Quinteiro
ea7c509afd win32: fix warning 2016-01-15 11:56:01 +01:00
Руслан Ижбулатов
37bd22c3d9 GDK W32: Don't use WM-drawn shadow for tooltips
This prevents WM from drawing shadows around tooltip windows,
which, in Adwaita, should have no shadow and are CSD-ish (which means
that tooltip window is larger than it looks, and WM draws the shadow
only on the outside, leaving a gap between the visible tooltip edge and
the shadow).

https://bugzilla.gnome.org/show_bug.cgi?id=759898
2016-01-14 14:53:15 +00:00
Paolo Borelli
3cd79c11fc win32: remove _gdk_root global variable 2016-01-14 14:30:37 +01:00
Paolo Borelli
7f17468afc W32: avoid code duplication in gdkdevice-win32|virtual
The same get_position function is cut and pasted in the two
classes.
2015-12-22 09:31:56 +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
Paolo Borelli
2e5616b27e Win32: move CoInitialize to dnd init
Functions requiring CoInitialize are called just in two places:
 - the filechooser thread which calls its own CoInitializeEx
 - the dnd code

Moving CoInitialize in the dnd specific init is cleaner and
we can pair it with the corresponding CoUninitialize since
CoUninitialize should be called as many times as CoInitialize.
Note that it is ok to call this function multiple times, so it
will not break if another codepath will need it in the future.

The patch also replaces the deprecated CoInitialize with the
equivalent call to CoInitializeEx (already used in the filechooser).
2015-12-17 17:18:01 +01:00
Carlos Garnacho
5d6a2ae54f win32: Use GdkSeatDefault to implement GdkSeat 2015-12-15 00:40:22 +01:00
Matthias Clasen
268c7a3e44 gdk: Allow passing the start coordinates in drag_begin
Add a variant of gdk_drag_begin that takes the start position
in addition to the device. All backend implementation have been
updated to accept (and ignore) the new arguments.

Subsequent commits will make use of the data in some backends.
2015-12-13 10:39:43 -05:00
Руслан Ижбулатов
3701a60401 GDK W32: Add a comment for clarity
This is a copy of a similar comment in another place, which explains
why WS_EX_TRANSPARENT windows get a special treatment.

https://bugzilla.gnome.org/show_bug.cgi?id=758484
2015-11-26 17:58:47 +00:00
Руслан Ижбулатов
8b7783ce21 GDK W32: Clarify the use of the second argument to SetWindowPos()
https://bugzilla.gnome.org/show_bug.cgi?id=758484
2015-11-26 17:58:46 +00:00
Руслан Ижбулатов
db1b24233e GDK W32: Don't use SetWindowLong() to set/unset WS_EX_TOPMOST
While searching for the cause of bug 746745 it was discovered that one could
not set WS_EX_TOPMOST extended window style with SetWindowLong(),
but must use SetWindowPos() for that purpose.

This was never a problem most likely because it is highly unlikely for windows
to acquire/lose WS_EX_TOPMOST after they are created, by means other
than SetWindowPos() (which GTK does use to raise/lower windows and
set/remove keep_above), and because trying to set/unset WS_EX_TOPMOST with
SetWindowLong() results in WS_EX_TOPMOST merely not being set/unset (that is,
other styles are still set/unset within the same call and no error is
signalled).

https://bugzilla.gnome.org/show_bug.cgi?id=758483
2015-11-26 16:26:32 +00:00
Руслан Ижбулатов
f407871b87 GDK W32: Only restack windows with matching always-on-top status
This prevents normal application windows (and other kinds of windows)
from being moved up in Z-order to be above windows that have the
always-on-top bit set. Doing so would make the previously-normal windows
in question also always-on-top implicitly.
Windows that are already always-on-top will be restacked on top of other
always-on-top windows too.

https://bugzilla.gnome.org/show_bug.cgi?id=746745
2015-11-22 03:20:10 +00:00
Руслан Ижбулатов
6b7951b219 GDK W32: Refactor restacking functions a bit 2015-11-22 03:18:43 +00: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
Matthias Clasen
364d1a574b Don't use g_slist_next in the windows backend
We generally use ->next directly.
2015-10-20 06:14:57 -04:00
Matthias Clasen
c860492359 Clean up handling of _gdk_win32_grab_cursor
This is a variable holding a ref to an object, so it is
a great case to use g_set_object and g_clear_object.

 # Please enter the commit message for your changes. Lines starting
2015-10-17 12:45:25 -04:00
Руслан Ижбулатов
00b39e4a82 W32: Add missing reference taking in gdk_device_virtual_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=756160
2015-10-17 16:39:58 +00:00
Ignacio Casal Quinteiro
c888a927e7 win32: fix warnings about signed/unsigned mismatch 2015-10-16 09:22:39 +02: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
Alexander Larsson
9bda0532f8 gdk: Finish conversion to in-struct GdkWindow list nodes 2015-09-21 16:59:51 +02:00
Chun-wei Fan
6423a02c55 MSVC Builds: Massive Rename of Projects
We need to rename the projects so that when these projects are added
into an all-in-one solution file that will build the GTK+ 2/3 stack,
the names of the projects will not collide with the GTK+-2.x ones,
especially as GTK+-2.x and GTK+-3.x are done to co-exist on the same
system.  This is due to the case that the MSVC projects are directly
carried over from the GTK+-2.x ones and was then updated for 3.x.

We still need to update the GUIDs of the projects, so that they won't
conflict with the GTK+-2.x ones.
2015-09-15 18:51:33 +08:00
Chun-wei Fan
d836a52b68 build: Clean Up Visual Studio Project Generation
Use the common automake module from the previous commit in the
Makefile.am's, which means that the Makefile.am's in gdk/ and gtk/ can be
cleaned up as a result.  As a side effect, the property sheet that is used
to "install" the build results and headers can now be generated in terms of
the listing of headers to copy during 'make dist', where we can acquire
most of the list of headers to "install", so that we can largely avoid the
situation where the property sheet files are not updated in time for this,
causing missing headers when this build of GTK+ is being used.

Also use the Visual Studio Project file generation for the following
projects:
gtk3-demo
gtk3-demo-application
gtk3-icon-browser
gdk-win32
gdk-broadway
gail-util

So that the maintenace of these project files can be simplified as well.

https://bugzilla.gnome.org/show_bug.cgi?id=681965
2015-09-15 18:37:37 +08:00
Руслан Ижбулатов
4a26366ff2 GDK W32: Add missing commas 2015-08-14 12:12:01 +00:00
Matthias Clasen
b3fb1aefd8 win32: Support all css cursor names
Approximate some of the resize cursors with similar cursors.
2015-07-26 01:43:56 -04:00
Pavel Grunt
44608dadc6 gdk-win32: Send fake release key event for shift key
Windows does not send any release key event for one of the shift keys
when both shift keys were pressed together. This commit solves
the problem by sending the extra release key event for the shift key
which was released as first, when the other shift key is released.

Other modifiers (e.g. Ctrl, Alt) do not have this problem.

https://bugzilla.gnome.org/show_bug.cgi?id=751721
2015-07-23 17:52:01 +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