Commit Graph

1211 Commits

Author SHA1 Message Date
Chun-wei Fan
e076cc7b1f GDK/Win32: Fix build after GDK Root Window and DND changes
Ensure that things build again, and instead use the Windows API to
acquire the screen dimensions (note: this may need to be scaled for
HiDPI, but since I do not own a WinTab-based device, I will need to
keep the dimensions as-is for now).

Also update the gdkdnd-win32.c code to use formats rather than targets.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-11-22 22:18:28 +08:00
Matthias Clasen
c2f6208ce5 Add private api for setting cursor theme
This is implemented in multiple gdk backends,
and we can avoid and ugly ifdef cascade in gtk
by adding a vfunc for this.
2017-11-17 17:42:12 -05:00
Matthias Clasen
dbb18ad5d8 gdk: Add a private method to get a server timestamp
This is needed in the clipboard code. We don't make
it public, since that code is destined to eventually
live in gdk anyway.
2017-11-17 15:39:08 -05:00
Matthias Clasen
0f2d7d41f1 win32: Remove remaining uses of GdkScreen 2017-11-17 13:47:15 -05:00
Matthias Clasen
d24ae9c032 win32: Make GdkWin32Screen a plain object
No need to derive this from GdkScreen anymore.
2017-11-17 13:47:14 -05:00
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
Matthias Clasen
e8353eab26 win32: Remove an unused include
No GdkScreen apis are used in here.
2017-11-17 13:20:53 -05:00
Matthias Clasen
abb1d59d4e Stop calling _gdk_screen_close
It does nothing useful, and is going away.
2017-11-17 10:51:55 -05:00
Matthias Clasen
fc0f7dc217 Remove gdkprivate.h
This is one-too-many private headers. Move the few
declarations here to gdkinternals.h.
2017-11-17 00:34:04 -05:00
Matthias Clasen
3f0d42f74b Stop including gdkmain.h
It is empty now.
2017-11-17 00:16:09 -05:00
Matthias Clasen
6e94be3f50 Drop the error trap vfuncs
No longer used.
2017-11-17 00:08:24 -05:00
Benjamin Otte
4c4e914806 gdk: Replace GDK_NONE with NULL 2017-11-15 19:07:17 +01:00
Benjamin Otte
fb94f79094 selection: Remove #ifdef WAYLAND
Instead, turn the functions into backend API:
  gdk_broadway_display_add_selection_targets()
  gdk_broadway_display_clear_selection_targets()
Remove the old per-backend functions, too.
2017-11-15 19:07:16 +01:00
Matthias Clasen
0436cc44fc win32: Remove all checks for GDK_WINDOW_ROOT
We are no longer creating windows of this type, so no
need to check for it.
2017-11-14 18:16:19 -05: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
Chun-wei Fan
c06b1cc103 Win32: Re-work cursor handling
Like the X11 and Wayland backends, re-work how the cursors are being
handled.  So, we use a hash table to cache up the HCURSORS that we
create along the way.

We still need to cache up the icon/cursor themes since this is something
that is not part of Windows but was added on to support icon/cursor themes
such as Adwaita on Windows, but should be in-line with what is going on in
GdkCursor.

Also, remove the _gdk_grab_cursor global variable in gdkprivate-win32.h,
and replace it with another variable in the GdkWin32Display structure,
to make things cleaner in the process.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-11-09 08:30:09 +08:00
Matthias Clasen
20fab69c38 Drop gdk_display_get_root_window
This is no longer used.
2017-11-05 21:45:51 -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
Matthias Clasen
be75984485 win32: Make gdk_win32_display_get_root_window available
This will be used to replace the equivalent frontend api,
which is going away.
2017-11-05 21:45:51 -05:00
Benjamin Otte
70846c85b3 window: Make icons GdkTextures
Cairo surfaces are bad, mkay?
2017-11-05 00:07:17 +01:00
Chun-wei Fan
3228149892 gdk/win32: Fix Win32 GL Context switching
Since on Windows we need to use a good amount of temporary GL contexts,
we need to switch back to the original GL contexts we were using when
we are done with the temporary GL contexts, otherwise multi-GL windows
will cause confusions causing display artifacts and crashes.

Also, use the GdkWin32GLContext::gl_hdc consistently throughout
the code and remove the GdkWin32Display::gl_hdc as Lukas K pointed out
that GdkWin32Display::gl_hdc becomes out-of-date and so the HDC that the
GL context is bound to becomes incorrect in sceanarios using multiple
windows with GtkGLArea/GdkGLArea items (which would cause the artifacts in
programs that use multiple windows with GtkGLArea/GdkGLArea items, and it
turns out that GdkWin32Display::gl_hdc is actually not necessary to help
keep track of the HDCs we use for our GL contexts.

This will also fix on Windows with GDK_GL=always, or when GSK's gl
renderer is used.

Partly based on patch from Lukas K <lu@0x83.eu>

https://bugzilla.gnome.org/show_bug.cgi?id=789213
2017-11-04 10:39:03 +08: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
Benjamin Otte
4e7a056777 gdk: Cursors are created generically
There are no longer subclasses for cursors now.
2017-11-04 00:07:13 +01:00
Benjamin Otte
81c2bebaca gdk: Remove ability to download a cursor 2017-11-04 00:07:13 +01:00
Benjamin Otte
a1759a0a52 gdk: Get rid of GdkCursorType
Now that we no longer have API that uses cursor types, don't keep them
around.
2017-11-04 00:07:13 +01:00
Benjamin Otte
9c98adcd15 gdk: Remove GdkWindow.set_device_cursor() vfunc
That one calls through to GdkDevice.set_window_cursor(), so let's just
use that one.
2017-11-02 12:42:58 +01:00
Matthias Clasen
5bd8884bf8 Stop providing the owner in GdkEventOwnerChange
This information is rarely useful, and it is one
of the last places where we create foreign windows.
2017-11-01 22:53:24 -04:00
Matthias Clasen
2a60928157 t Remove gdk_cursor_new_for_display
The preferred api to create cursors is by name, and the
GdkCursorType enumeration can directly trace its ancestry
to the horrible X cursor font. So lets stop using it.
2017-11-01 21:49:05 -04:00
Matthias Clasen
3b7763eebc Drop gdk_screen_get_display
This is not longer used.
2017-11-01 20:57:46 -04:00
Matthias Clasen
dcf2553f23 win32: Stop using gdk_screen_get_display
We can just use the field directly.
2017-11-01 20:54:50 -04:00
Matthias Clasen
7f0b5297c6 Drop gdk_display_get_default_screen
Also remove the backend implementations.
This api is no longer used.
2017-11-01 19:44:28 -04:00
Matthias Clasen
473c642131 win32: Remove an unused function
This also removed the last use of gdk_display_get_default_screen
from the win32 backend.
2017-11-01 19:44:28 -04:00
Matthias Clasen
727aa6cb08 Drop the monitors-changed signal
We are not using it anymore.
2017-10-31 22:42:33 -04:00
Matthias Clasen
524fcbecfd Drop gdk_screen_get_root_window
This function is no longer used.
2017-10-31 21:28:28 -04: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
Matthias Clasen
5cb5bdf1bc Add gdk_display_get_toplevel_windows
This is replacing the corresponding GdkScreen api, which
is going away. To implement this, we need to add a
get_root_window vfunc to GdkDisplay.
2017-10-31 20:29:48 -04:00
Matthias Clasen
2d6bd1ae6d Drop gdk_window_get_screen
This includes removing the GdkScreen argument from the
create_window_impl display vfunc.
2017-10-31 17:25:01 -04:00
Matthias Clasen
a3cffa5072 Drop GdkScreen from GdkDevice apis
Returning the screen does not add anything here and
GdkScreen is going away.
2017-10-31 12:30:38 -04:00
Matthias Clasen
f8cad19829 dnd: Drop GdkScreen from apis
Drop the screen argument from gdk_dnd_find_window_for_screen
and rename the function to gdk_dnd_find_window. The screen
argument does not add anything here since the drag context
is already tied to the display. Update all backends, and
update all callers.
2017-10-31 10:18:10 -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
Lukas K
15491cf6e4 make GDK_DEBUG=opengl work on win32 2017-10-30 14:39:55 +08:00
Benjamin Otte
f29b7744bb gdk: Remove leftovers from GdkScreen::size-changed removal 2017-10-30 02:30:44 +01:00
Chun-wei Fan
006207e95e gdk/win32/gdkwindow-win32.c: Fix gdk_win32_window_set_icon_list()
The list of surfaces passed into the function may be NULL, so don't try
to initialize the surfaces if it is so, to avoid a crash.

Also, remove the cast to GdkPixbuf* for getting surfaces->data, as we
are already using a cairo_surface_t*.

https://bugzilla.gnome.org/show_bug?id=773299
2017-10-25 00:46:50 +08:00
Chun-wei Fan
4d44865f42 gdk/win32/gdkwindow-win32.c: Fix build
Make up for the missed commas...
2017-10-24 13:56:29 +08:00
Alexander Larsson
d3fc937b4d GtkWindow/GdkWindow: Finish converting icons to surfaces
There were some parts left, for instance gdk_window_set_icon_list.
2017-10-23 13:45:25 +02:00
Carlos Garnacho
a9988e18b0 gtk: Remove 2BUTTON and 3BUTTON events and event types
Those should be interpreted by widget-local gestures, not guessed at a
high level with no notions of the specific context. Users will want
GtkGestureMultiPress to replace these events.
2017-09-19 18:40:50 +02:00
Emmanuele Bassi
6240082e12 Drop old MSC makefiles 2017-08-14 22:23:09 +01:00
Emmanuele Bassi
391d1a04ec Drop Autotools build
We are officially switching to Meson as the default build system for
GTK+.
2017-08-14 22:23:09 +01:00
Matthias Clasen
9859f8f69f Allow passing a NULL window to gdk_device_query_state
Interpret NULL as "root window" here - we only have one
screen nowadays, so there is no choice involved, and this
will let us avoid dealing with the root window in the
fontend code.
2017-08-11 15:45:24 -04:00
Matthias Clasen
c409fca703 Drop root windows from some internal apis
_gdk_device_query_state was needlessly shuffling
root windows around.
2017-08-11 15:45:23 -04:00