Commit Graph

7275 Commits

Author SHA1 Message Date
Andrew Chadwick
6e197afc44 wintab: fix skipping of odd-numbered devices
Fix a regression introduced in 4ce6d10601
which causes devices with an odd-numbered zero-based index in the list
to be passed over incorrectly. This might present as yet another "device
does not send pressure" bug for ~50% of devices out there.

This commit also closes off another potential segfault for wintab_devices
lists which have an odd length.

https://bugzilla.gnome.org/show_bug.cgi?id=774699
2016-11-21 19:11:09 +01:00
Chun-wei Fan
724e7f48e7 gdk/win32/gdkwindow-win32.c: Fix build
Fix the assignment of ->create_draw_context, in which an underscore is
accidently added.
2016-11-21 15:40:28 +08:00
Chun-wei Fan
18b1305d08 build: Complete renaming of broadwayd to gtk4-broadwayd
The parts where the Visual Studio projects are generated must also be updated
so that 'make dist' will work properly.
2016-11-21 15:09:35 +08:00
Benjamin Otte
e62a4d8eea API: gdk: Remove ability to render window contents
The functions gdk_pixbuf_get_from_window() and
gdk_cairo_set_source_window() are unreliable and depend on the windowing
system (they work great on X11 and Win32, less so on Quartz and Wayland).

With the switch to new drawing API and OpenGL, we can definitely no
longer support a generic way to snapshot windows.

People should either write windowsystem-specific code or draw their
widgets directly - like with gtk_widget_draw() - if they need to get a
rendering.
2016-11-20 11:47:44 +01:00
Benjamin Otte
1492175a28 window: Remove unused destroy_draw_context vfunc 2016-11-20 07:27:00 +01:00
Benjamin Otte
cb18752f94 gdk: Make each backend have a custom GdkDrawingContext subclass 2016-11-20 07:19:52 +01:00
Matthias Clasen
b15bc437a6 Rename broadwayd to gtk4-broadwayd
This was the last unprefixed binary, and it was causing file
conflicts between gtk3 and gtk4.
2016-11-18 13:40:37 -05:00
Olivier Fourdan
36575a4424 gdkwindow: Allow native subsurface for all parents
Under Wayland, a subsurface can have another surface as parent, but
gdk would not allow native windows if the parent is not the root window.

Allow native subsurface for all parent under Wayland, not just for the
root window.

https://bugzilla.gnome.org/show_bug.cgi?id=774475
2016-11-18 13:25:36 -05:00
Carlos Garnacho
665c3a2877 wayland: Keep last scale factor on surfaces after it left all outputs
This can be triggered on workspace switches, and on hidpi results in
the scale factor being reset to 1 while the window is not in the
current workspace.

https://bugzilla.gnome.org/show_bug.cgi?id=774476
2016-11-18 13:24:31 -05:00
Benjamin Otte
c162b87ebd gdk: Fix a variable
The passed in surface is the current_paint surface, so I guess this
usage hasn't been noticed.
2016-11-17 22:11:33 +01:00
Carlos Garnacho
f90dcb33f9 gdk: Fix win32 build typo
We've left libgdk-3 behind. Noticed by Andrew Chadwick, spotted
by Emmanuele Bassi.
2016-11-15 17:09:30 +01:00
Andrew Chadwick
83712a48f4 win32: remove an unused func operating on GdkColor
https://bugzilla.gnome.org/show_bug.cgi?id=774347
2016-11-14 14:11:36 -05:00
Olivier Fourdan
4ae1eab3b1 Revert "gdkwindow: configure native windows in move_native_children()"
This reverts commit 9e2b1ad39e.
2016-11-14 12:24:18 +01:00
Olivier Fourdan
5ccc570cca Revert "gdk: Get rid of unused variables"
This reverts commit 7016409e9f.
2016-11-14 12:24:18 +01:00
Chun-wei Fan
fcd216a409 gdkscreen-win32.c: Also define _WIN32_WINNT
As in the last commit on gdkdisplay-win32.c, we need to define that to be
0x0600 (Vista) or later so that the items needed in the Windows headers be
activated.

See: https://bugzilla.gnome.org/show_bug.cgi?id=768081#c62
2016-11-11 21:06:01 +08:00
Chun-wei Fan
718efc2f59 gdkdisplay-win32.c: Define _WIN32_WINNT
... to be for Vista (0x0600) or later.  This is so that the necessary
items in the Windows headers be activated so that the code will build
properly on mingw-w64, and we already require Vista or later for GTK+.

Thanks Ting-Wei Lan for pointing this out.

See: https://bugzilla.gnome.org/show_bug.cgi?id=768081#c62
2016-11-11 20:58:16 +08:00
Massimo Valentini
8121860251 GdkGLContext: chain finalize handler
https://bugzilla.gnome.org/show_bug.cgi?id=773979
2016-11-10 14:34:31 -05:00
Florian Müllner
d163aba030 gdkdisplay-wayland: Add API to set startup notification ID
For wayland clients, the startup notification ID is currently only set
from the DESKTOP_STARTUP_ID environment variable. As that variable is
only set for clients launched via exec(), startup completion is not
indicated correctly for DBus-activated applications unless an explicit
ID is specified - usually that is not the case, as the default handling
uses gdk_notify_startup_complete().
To address this, we need API to set the startup notification ID from GTK
as we have on X11.

https://bugzilla.gnome.org/show_bug.cgi?id=768531
2016-11-09 14:18:14 -05:00
Chun-wei Fan
e470567fd0 gdkprivate-win32.h: Complete removal of attributes_mask
We removed this parameter from the function declaration, but not the
prototype.  Fix that.
2016-11-07 14:37:32 +08:00
Benjamin Otte
b04e25f29b gdk: gdk_window_new() is not called for foreign windows
So we can remove the special cases that were used for them.
2016-11-07 03:15:00 +01:00
Benjamin Otte
d2c26c471c gdk: Remove attributes_mask from gdk_window_new()
The only remaining values were always treated as 0, so we just hardcode
them to 0.
2016-11-07 01:33:43 +01:00
Benjamin Otte
9fe8b1e112 API: gdk: Remove gdk_window_new()
It's finally no longer public API.
2016-11-07 01:12:47 +01:00
Benjamin Otte
3b93773add API: gdk: Add gdk_window_new_temp()
Your one stop shop for all those nasty hidden input-only windows.
2016-11-07 01:03:17 +01:00
Benjamin Otte
24d0baec38 API: gdk: Add gdk_window_new_popup()
... and use it.
2016-11-06 23:47:56 +01:00
Benjamin Otte
b30afff511 API: wayland: Add gdk_wayland_window_new_subsurface()
... and use it instead of gdk_window_new().
2016-11-06 21:36:43 +01:00
Benjamin Otte
87f07bac6b API: gdk: Add gdk_window_new_toplevel()
... and use it in GTK.
2016-11-06 17:40:59 +01:00
Benjamin Otte
7a6cab14eb gdkwindow: Remove GdkWindowAttr.type_hint
Instead, let the callers call gdk_window_set_type_hint(). Which is
surprsingly what every backend did.
2016-11-06 16:22:21 +01:00
Benjamin Otte
b7619a2603 x11: Set override_redirect on input-only windows
b9955cfff1 broke this.
2016-11-06 15:43:06 +01:00
John Ralls
2c642dd654 Update gdk-quartz functions for the demise of GdkDeviceManager. 2016-11-05 15:08:59 -07:00
John Ralls
2b53583e80 Remove screen height and width functions from gdk-quartz.
Since they were previously deleted from gdk.
2016-11-05 15:08:59 -07:00
John Ralls
a45f96e9cb Update GdkOSXVersion enum with the last 4 MacOS releases. 2016-11-05 15:08:59 -07:00
Benjamin Otte
a659bbecb9 win32: Remove unused headers 2016-11-05 03:35:36 +01:00
Benjamin Otte
9707f4d3b3 API: gdk: Remove title from gdk_window_new()
Use gdk_window_set_title() afterwards instead.
2016-11-05 03:32:27 +01:00
Benjamin Otte
b9955cfff1 API: gdk: Remove override_redirect flag from GdkWindowAttr
When you want an override-redirect window, you create it that way by
creating a GDK_WINDOW_TEMP window.
2016-11-05 03:32:27 +01:00
Benjamin Otte
33e7a7898f API: gdk: Remove gdk_window_set_override_redirect()
When you want an override-redirect window, you create it that way.
Changing that behavior is not supported anywhere (but on X of course).
2016-11-05 03:32:27 +01:00
Matthias Clasen
338534fb8d Fix up the fullscreen_on_monitor support
I didn't pay attention, and forgot to port this code to the
new monitor apis.
2016-11-04 12:41:51 -04:00
Rui Matos
b8fc4c246a gdkwindow-x11: Add support for gdk_window_fullscreen_on_monitor
This way we can recommend that applications use the
fullscreen_on_monitor() API on both X and Wayland otherwise they'd
have to keep a path for each backend to achieve this functionality.

https://bugzilla.gnome.org/show_bug.cgi?id=773857
2016-11-04 12:10:43 -04:00
Руслан Ижбулатов
e75878f976 W32: Fix malformed svg file
https://bugzilla.gnome.org/show_bug.cgi?id=768081
2016-11-04 13:36:34 +00:00
Chun-wei Fan
6abd65c83b GDK-Win32/4.0: Enable HiDPI support for Windows
This enables HiDPI support for GTK+ on Windows, so that the
fonts and window look better on HiDPI displays.  Notes for the current
work:

-The DPI awareness enabling can be disabled if and only if an application
 manifest is not embedded in the app to enable DPI awareness AND a user
 compatibility setting is not set to limit DPI awareness for the app, via
 the envvar GDK_WIN32_DISABLE_HIDPI.  The app manifest/user setting for
 DPI awareness will always win against the envvar, and so the HiDPI items
 will be always setup in such scenarios, unless DPI awareness is disabled.

-Both automatic detection for the scaling factor and setting the scale
 factor using the GDK_SCALE envvar are supported, where the envvar takes
 precedence, which will therefore disable automatic scaling when
 resolution changes.

-We now default to a per-system DPI awareness model, which means that we
 do not handle WM_DPICHANGED, unless one sets the
 GDK_WIN32_PER_MONITOR_HIDPI envvar, where notes for it are in the
 following point.

-Automatic scaling during WM_DISPLAYCHANGE is handled (DPI setting change of
 current monitor) is now supported.  WM_DPICHANGED is handled as well,
 except that the window positioning during the change of scaling still
 needs to be refined, a change in GDK itself may be required for this.

-I am unable to test the wintab items because I don't have such devices
 around.

https://bugzilla.gnome.org/show_bug.cgi?id=768081
2016-11-04 18:14:48 +08:00
Chun-wei Fan
3baa4a9741 gdkscreen-win32.c: Remove leftovers of removal of visual APIs
There were some more items that ought to be removed.  Remove them.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2016-11-04 17:28:12 +08:00
Benjamin Otte
4b88b81e67 x11: Init no-multihead monitor without root window
Previous code gave warnings because the root window wasn't initialized
yet.
2016-11-04 00:33:13 +01:00
Benjamin Otte
7c474c689a wayland: Remove all mentions of visuals 2016-11-04 00:17:57 +01:00
Benjamin Otte
77a9e90cb9 mir: Remove all mentions of visuals 2016-11-04 00:15:52 +01:00
Benjamin Otte
8040d78c04 broadway: Remove all mentions of visuals 2016-11-04 00:15:07 +01:00
Benjamin Otte
31a0933fe9 quartz: Remove all mentions of visuals 2016-11-04 00:10:43 +01:00
Benjamin Otte
ec06a717ce win32: Remove all mentions of visuals 2016-11-04 00:08:03 +01:00
Benjamin Otte
4585af5719 gdk: Remove visual APIs from GdkScreen
gdk_screen_list_visuals(), gdk_screen_get_system_visual() and
gdk_screen_get_rgba_visual() are gone now.
2016-11-04 00:02:37 +01:00
Benjamin Otte
fe08641205 x11: Maointin window visuals without GdkVisual
That way, we don't need a GdkScreen to create a GdkWindow anymore.
2016-11-03 23:54:39 +01:00
Benjamin Otte
b741d32262 x11: Remove unused hash table
We were neatly populating it, but nobody ever looked at it.
2016-11-03 22:47:42 +01:00
Benjamin Otte
0192f93689 x11: Replace gdk_display_get_window_visual()
... with functions that don't use GdkVisual.

A small step towards getting rid of GdkVisual.
2016-11-03 22:40:36 +01:00
Benjamin Otte
d8d8059ee1 x11: Use X11 variables instead of GDK variables
This way, we avoid GdkVisual usage.
2016-11-03 20:33:33 +01:00
Benjamin Otte
4ebcb6fd1e x11: Remove unused complexity
With all Windows having the same visual, there's only ever one visual we
need to check.
2016-11-03 20:33:33 +01:00
Chun-wei Fan
53077f15d8 autotools: Update MSVC gir build script generation
Now that GTK+ is built as a single DLL, and the .lib that is built is
gtk-4.lib, we need to update the autotools sections in generating the
NMake Makefile snippets so that we can have the correct commands and flags
for building the .gir files, which will all now link to gtk-4-vsXX.dll (or
so).
2016-11-03 18:00:03 +08:00
Chun-wei Fan
abef8d4860 Windows: Update code for monolithic GTK DLL
Now that the autotools build folded the GDK/GSK bits into the main GTK+
DLL, there are some updates that need to be done for this.  We need to:

-Fold the DllMain() of GDK-Win32 into the main GTK+ DllMain(), as we need
 the HINSTANCE to register the window.  We can't have two DllMain()'s in a
 single DLL.
-Remove the GDK rc(.in) files, as that is not used anymore.  Make the GTK+
 .rc(.in) file load the gtk.ico GTK+ logo file instead so that we still
 get the GTK+ logo for the application icon by default.  Update the
 autotools build files as well.
-Revert commit b9f9980 as LRN pointed out in comment 25 in bug 773299, as
 GTK+ is now a monolithic DLL, and we ought not to export this private
 function.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2016-11-03 16:55:35 +08:00
Olivier Fourdan
2324b96a32 wayland: check valid pending cairo surface
gdk_wayland_window_attach_image() is normally called from
gdk_window_end_paint() to notify the compositor of newly staged drawing.

If any of the drawing code inadvertently dispatches the wayland event
loop (for instance with a gdk_flush() call), then it's possible that by
the time gdk_window_end_paint() is called, the staged drawing is already
destroyed.

This commit bypasses the attach_image call in scenarios where the staged
drawing is prematurely dropped.

https://bugzilla.gnome.org/show_bug.cgi?id=773274
2016-11-03 08:50:34 +01:00
Chun-wei Fan
2d7df8e66a gdk/win32: Complete gdk_screen_is_composited() removal
Commit d249e77 (API: screen: Remove gdk_screen_is_composited()) attempted
to update the GDK-Win32 for the removal of the API, but some parts were
missed.  This updates the code so that things continue to build and run.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2016-11-02 15:37:10 +08:00
Juan Pablo Ugarte
c607d51890 Use GLSL version 110 for OpenGL 2 shaders.
According to docs and Intel legacy drivers,
GLSL version 130 is for GL 3.0 not GL 2.0/2.1

Validated files with reference compiler from
https://www.khronos.org/opengles/sdk/tools/Reference-Compiler/
2016-11-01 15:42:46 -03:00
Matthias Clasen
7a2537866b Drop GdkColor
It is deprecated and no longer used.
2016-11-01 13:58:11 -04:00
Benjamin Otte
3d8b00600e gdkgl: Change prototype of function
The function does not upload a cairo surface, it uploads pixel data.

So don't take a cairo surface as an argument, take pixel data.
2016-11-01 16:32:26 +01:00
Emmanuele Bassi
567f6373c8 build: Clean the uninstalled introspection GIR files
We need to remove them from the build when cleaning them.

Additionally, this automatically adds them to the Git ignore file.
2016-10-31 16:30:10 +00:00
Juan Pablo Ugarte
50056d804b gdk/Makefile.am: fixed glsl resources extra dist files.
Use the same wildcard partern used to generate gdk.gresource.xml to include files in EXTRA_DIST var.
2016-10-31 10:15:05 -03:00
Benjamin Otte
d028667fc6 display: Actually initialize variables
Forgot to add this in d249e77bcb.
2016-10-29 18:10:26 +02:00
Benjamin Otte
d249e77bcb API: screen: Remove gdk_screen_is_composited()
Switch code to use gdk_display_is_composited() instead.

The new code also doesn't use a vfunc to query the property but rather
requires the backend to call set_composited()/set_rgba() to change the
value.
2016-10-29 04:49:47 +02:00
Benjamin Otte
42d8142cc7 API: gdk: Add gdk_display_is_rgba() and gdk_display_is_composited()
Also add properties for those two properties.

The first property is equivalent to checking if an RGBA visual exists,
the 2nd is equivalent to gdk_screen_is_composited().
2016-10-29 04:49:47 +02:00
Chun-wei Fan
b960008955 GDK-Win32/4.0: Improve GL on Windows
Update the GDKGL implementation:

-Allow legacy contexts to be created.
-Use finer-grained attributes to ask for a pixel format when possible,
 which also adds support for anti-aliasing

In fact the changes here are required for GTKGL to work properly on
Windows for 4.x.

Note that creation of gles contexts is not done here, as the system does
not support such contexts directly on Windows, but only through means such
as ANGLE, which is a totally different issue here.

https://bugzilla.gnome.org/show_bug.cgi?id=773528
2016-10-28 15:56:49 +08:00
Chun-wei Fan
fcecec1a9d GDK/Win32: Deal with leftovers from removal of GdkWindow items
We need to further remove items for the removal of:
-GdkWindow->depth (commit 6cc94ff)
-gdk_window_get_visual()/GdkWindow->visual (commit f420dc7)
-GDK visual query APIs (commit 45c0379)

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2016-10-28 15:56:36 +08:00
Benjamin Otte
45c0379f87 API: gdk: Remove visual querying APIs
They are unused, only work on the default display anyway and visuals are
on their way out.
2016-10-28 05:22:50 +02:00
Benjamin Otte
f420dc7456 API: gdk: Remove gdk_window_get_visual()
With it, remove window->visual.
2016-10-28 05:22:49 +02:00
Benjamin Otte
6cc94ff176 gdk: Remove GdkWindow.depth member variable
It's unused.
2016-10-28 05:22:32 +02:00
Benjamin Otte
cd67c0d7cc window: Add a GdkWindow:display property
... and make it an explicit property of the window struct instead of
looking it up in the visual.
2016-10-28 04:45:35 +02:00
Benjamin Otte
56b25e2574 x11: Remove code that temporarily unsets the background
We don't set a background anymore, so we don't need to temporarily unset
it.
2016-10-27 06:37:02 +02:00
Benjamin Otte
dd105f3db8 gdk: Remove gdk_window_set_invalidate_handler()
It's not used anymore.
2016-10-27 05:03:06 +02:00
Benjamin Otte
b1f61b6fcc gdk: Add deprecation guards around deprecated function 2016-10-27 05:03:06 +02:00
Matthias Clasen
42a5608af6 Fix the build
Copy-paste error.
2016-10-26 10:45:04 -04:00
Matthias Clasen
9aa1257bd0 GdkWindow: Use the seat to enumerate devices
GdkDeviceManager is going away.
2016-10-26 10:36:32 -04:00
Matthias Clasen
7fa09a3e3a quartz: Stop using gdk_device_manager_list_devices
The function has been deprecated.
2016-10-26 10:36:32 -04:00
Matthias Clasen
35fda80a4b x11: Stop using gdk_device_manager_list_devices
The function has been deprecated.
2016-10-26 10:36:32 -04:00
Matthias Clasen
d2d209865b broadway: Stop using gdk_device_manager_list_devices
The function is deprecated.
2016-10-26 10:36:32 -04:00
Alexander Larsson
723b588b5d Make gdk.la and gsk.la a noninst helper library
This merged gtk, gdk and gsk into one library, making it possible to
have internal private APIs between gtk them, as well as producing more
efficient code.

https://bugzilla.gnome.org/show_bug.cgi?id=773100
2016-10-26 16:34:15 +02:00
Chun-wei Fan
4b3c0314dd gdk/win32/gdkevents-win32.c: Avoid gdk_device_manager_get_core_pointer()
This function has been removed, so replace it with gdk_seat_get_pointer().

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2016-10-26 18:54:51 +08:00
Chun-wei Fan
2ba64e0b62 MSVC builds: Support MSVC 2013 and later
We now need C99 features from the compiler which are only supported by
Visual Studio 2013 and later, so drop the MSVC 2008~2012 projects, and make
the baseline supported Visual Studio version be 2013.  Update the build files
as a result.
2016-10-26 16:46:38 +08:00
Rico Tzschichholz
b4c37bfff8 visual: Remove deprecated API 2016-10-26 10:12:58 +02:00
Rico Tzschichholz
e0b1f2e5f4 Remove deprecated gdk_display_open_default_libgtk_only 2016-10-26 10:06:23 +02:00
Matthias Clasen
cbe1337aa1 Revert "Remove gdk_device_grab/ungrab from the API"
This reverts commit efc37d0855.

Turns out we need to clean up the dnd code some more, first.
2016-10-25 21:24:37 -04:00
Matthias Clasen
f350e346e4 Drop the deprecated gdk_device_manager_get_client_pointer 2016-10-25 21:06:25 -04:00
Matthias Clasen
efc37d0855 Remove gdk_device_grab/ungrab from the API
These are still used in a few places internally,
so make them private.
2016-10-25 20:03:34 -04:00
Matthias Clasen
5e4a05e5b7 Remove deprecated gdk_window_get_pointer 2016-10-25 19:45:48 -04:00
Matthias Clasen
1396d6c92a Remove some more deprecated display API
gdk_display_get_pointer, gdk_display_get_window_at_pointer and
gdk_display_warp_pointer have long been deprecated.
2016-10-25 19:31:24 -04:00
Matthias Clasen
ee7ddefce9 Remove deprecated gdk_display_list_devices 2016-10-25 16:04:01 -04:00
Matthias Clasen
dcda9c3d8c Remove deprecated GDK_DISPLAY_OBJECT macro 2016-10-25 16:02:07 -04:00
Matthias Clasen
e041345fcb Remove the last uses of GDK_DISPLAY_OBJECT
This is an obsolete macro.
2016-10-25 16:01:50 -04:00
Matthias Clasen
e642909823 Remove deprecated display ungrab functions 2016-10-25 15:56:52 -04:00
Matthias Clasen
6b231af45e Remove deprecated gdk_app_launch_context_set_display 2016-10-25 15:52:57 -04:00
Matthias Clasen
5cb3fc4c4f Drop deprecated gdk_display_get_screen 2016-10-25 15:35:44 -04:00
Matthias Clasen
0ba67021a9 Remove an unused function
This function is no longer used, now that offscreen windows are gone.
2016-10-25 15:32:02 -04:00
Matthias Clasen
4f1e06380c Remove deprecated gdk_app_launch_context_new 2016-10-25 15:27:42 -04:00
Matthias Clasen
78d0876c46 Remove deprecated gdk_display_get_n_screens 2016-10-25 15:21:46 -04:00
Alexander Larsson
70935f0952 Drop support for offscreen GdkWindows
These complicate a lot of GdkWindow internals to implement features
that not a lot of apps use, and will be better achieved using gsk.
So, we just drop it all.
2016-10-25 09:54:37 +02:00
Rico Tzschichholz
639898000e gdkwindow: Remove deprecated API 2016-10-24 12:22:32 +02:00
Rico Tzschichholz
7630c86468 gdk: Remove deprecated gdk_cairo_set_source_color 2016-10-24 10:36:55 +02:00