Commit Graph

7120 Commits

Author SHA1 Message Date
Emmanuele Bassi
8e85f55240 gl: Check whether use_es is positive
Now that the use_es field is an int with a possible negative value, we
cannot use it its truth value directly; we need to check if it's a
positive value, instead.
2016-10-22 02:40:08 +01:00
Emmanuele Bassi
31c05771e9 gl: Set legacy bit depending on OpenGL version
GDK defaults to asking for an OpenGL 3.2 Core Profile, but if we get a
legacy profile from the underlying windowing system, the OpenGL version
will be fixed to 3.0. If that happens, we need to set the legacy bit on
the GdkGLContext, since that bit will be used to determine the version
and type of GLSL shaders that will be used by application and toolkit
code alike.
2016-10-22 02:40:08 +01:00
Emmanuele Bassi
b878ec7f2f gdk/gl: Allow autodetection for GL/GLES
If the GdkGLContext was not explicitly instructed to use or not GLES, we
can detect whether the underlying API is going to be desktop GL or GLES.

https://bugzilla.gnome.org/show_bug.cgi?id=773180
2016-10-21 11:39:24 -04:00
Adam Jackson
627867863f gdk: Don't second-guess whether a context is GLES
We've already set ->use_es correctly at context creation time, all this
can possibly do is change our mind about what kind of GL we're using.

Signed-off-by: Adam Jackson <ajax@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=773180
2016-10-21 11:39:24 -04:00
Chun-wei Fan
5140bc97b3 gdkwindow-win32.c: Make code compatible with GDK 4.0 APIs
Port the code here so that things will continue to build and work on 4.x.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2016-10-21 16:21:32 +08:00
Carlos Garnacho
31db11dd5b wayland: Allow grabless xdg_popups
xdg_shell v6 allows grabless popups, whose behavior is not that
different from override redirect windows with no grab to take
keyboard input (and pointer events outside).

This means we can relax the requirement to have a grab before
creating an xdg_popup. The warning is still useful to have so
people stop relying on gdk_window_show();gdk_device_grab() being
an ok pattern to popup a window, it's been moved to wayland
implementation of gdk_device_grab() instead, so we warn if trying
to grab a GDK_WINDOW_TEMP window that's already visible.

https://bugzilla.gnome.org/show_bug.cgi?id=771694
2016-10-20 11:41:59 +02:00
Chun-wei Fan
8b8f378050 Visual Studio builds: Update from [gdk|gtk]-3 to [gdk|gtk]-4
This updates all the projects files to be be named appropriately as we move from GTK-3.x to 4.x,
and updates the autotools files so that things are distributed and generated properly.

Also remove deprecated/gtkstatusicon-quartz.c from gtk/Makefile.am, as that was causing 'make dist'
to fail as that file has been removed.

This fixes 'make dist' with the updated existing project files in proper order.

Note that this does not include the new GSK, which will be added later, so the project files do
not yet build the whole stack on Visual Studio at this point.
2016-10-19 18:39:36 +08:00
Rico Tzschichholz
6fb8f61124 gdk: Fix Since tag of gdk_cairo_surface_upload_to_gl 2016-10-18 13:38:08 +02:00
Rico Tzschichholz
310a1f7e90 gdk: Add missing Since tags for gdk_window_new_child/input
In addition to d22e5e69d9
2016-10-18 13:27:19 +02:00
Alexander Larsson
1c7c77bc94 gdk_cairo_surface_upload_to_gl: Don't apply device scale
The arguments to this function is the texture width/height, and these
are already scaled.
2016-10-18 11:49:14 +01:00
Emmanuele Bassi
0ce9815bd1 gdk: Add more GDK_GL_ERROR error ids
We're going to use them in other locations.
2016-10-18 11:49:07 +01:00
Emmanuele Bassi
b425cff689 gdk: Add utility for uploading Cairo surfaces to GL
The surface-to-GL upload logic has become more complicated with the
addition of the GLES code paths; it's more logical to have a public
utility function that can be called from GDK users, instead of copy
pasting the whole thing multiple times.
2016-10-18 11:29:34 +01:00
Matthias Clasen
95c7de70c7 x11: Add the same message as the wayland backend has
This seems prudent, if we make noise about missing cursors
on Wayland, we should do the same on X11.
2016-10-17 19:11:32 -04:00
Matthias Clasen
a0140cad15 Reduce a warning to a message
The warning interferes with having a testcase to check this behavior,
so reduce this to a message.
2016-10-17 19:11:32 -04:00
Benjamin Otte
d22e5e69d9 API: gdk: Add gdk_window_new_child() and gdk_window_new_input()
This is an attempt to get rid of gdk_window_new() for more specific use
cases. These 2 are for client-side windows - regular ones and input-only
ones resepectively.

So far all those functions just call into gdk_window_new().
2016-10-18 00:22:35 +02:00
Emmanuele Bassi
a0aa1d963a broadway: Remove redundant declaration 2016-10-17 14:56:38 +01:00
Emmanuele Bassi
20b2e479f8 build: Add various compiler warnings and errors
Just like GLib, GTK+ would benefit from getting warnings and errors from
the compilers.

We check various, common warnings, especially for a future use of C99;
additionally, we promote some warnings to errors, in order to ensure
that simple mistakes are caught during the development phase, before
they are submitted to the code repository.
2016-10-17 11:44:11 +01:00
Emmanuele Bassi
923b868400 gdk/x11: Constify argument 2016-10-17 11:10:14 +01:00
Emmanuele Bassi
68cab95c5d Remove re-declarations of public functions 2016-10-17 11:10:14 +01:00
Emmanuele Bassi
d64ca9560c Remove redundant declaration 2016-10-17 11:10:13 +01:00
Emmanuele Bassi
cf9b9a034b gdk: Comment out gdk_cairo_create() 2016-10-17 10:44:27 +01:00
Emmanuele Bassi
07cd87eb9c gdk: Remove mentions of gdk_cairo_create()
This function does not exist any more.
2016-10-17 10:44:27 +01:00
Benjamin Otte
a65a4de38d gdk: Remove old code to create drawing context
You now have to use a GdkDrawingContext
2016-10-16 18:18:58 +02:00
Benjamin Otte
e76ba9a3c3 gdk: Remove gdk_window_set_debug_updates()
The update tracking code was ugly and using deprecated drawing APIs. It
was also in the wrong place.

So instead of trying to keep it working, I'll remove it. We need to find
a better way to put it and make it work there.
2016-10-16 18:18:58 +02:00
Benjamin Otte
1a7dcb2053 gdk: Remove unused argument parsing structs 2016-10-16 18:17:21 +02:00
Benjamin Otte
59c702d88c gdk: Remove leftover structs from ClientMessage days 2016-10-16 18:17:21 +02:00
Benjamin Otte
10a7963ebf gdk: Remove unused structs from ColorMap days 2016-10-16 18:17:21 +02:00
Benjamin Otte
eace2cf421 API: Remove gdk_window_set_background()
Backgrounds are always transparent black.
2016-10-16 18:17:21 +02:00
Benjamin Otte
662001b60a API: Remove ability to set visuals on windows
And with it, gtk_widget_get_visual() and gtk_widget_set_visual() are
gone.

We now always use the RGBA visual (if available) and otherwise fall back
to the system visual.
2016-10-16 18:17:21 +02:00
Benjamin Otte
89f2e17f91 API: Remove gdk_window_set_composited()
And the related call gdk_display_supports_composite().
2016-10-16 18:17:21 +02:00
Benjamin Otte
8d54c641f1 screen: Remove unused vfunc
GdkScreenClass.broadcast_client_message was unused, but a bunch of
backends still had functions (not) implementing it.
2016-10-16 18:17:21 +02:00
Benjamin Otte
fec8069e7b API: screen: Stop storing font options
font options are only ever set by the GtkSettings object and only ever
used inside GTK, so just store them there.
2016-10-16 18:17:21 +02:00
Benjamin Otte
fcbd480c76 API: Remove GDK_WA_CURSOR
The cursor was set using gdk_window_set_cursor() even in
gdk_window_new().

So instead of having yet another flag, just make the users of that flag
call gdk_window_set_cursor() directly after the window was created.
2016-10-16 18:17:21 +02:00
Benjamin Otte
2fd5048943 API: window: Remove suppport for changing wmclass_name/group
X11 was the only backend to support it and people can just override it
using XSetClassHint() directly.
The docs already advertised the function as "Do not use".

Keep the existing call to XSetClassHint() in place, so that we keep
setting the same values as in GTK3.
2016-10-16 18:17:21 +02:00
Benjamin Otte
9be9e00a0e API: screen: Remove gdk_screen_make_display_name()
It's identical to gdk_display_get_name().
2016-10-16 18:17:21 +02:00
Benjamin Otte
6b9e481e38 API: screen: Remove gdk_screen_get_active_window()
... and gdk_screen_get_window_stack().

Those functions were originally added in
5afb4f0f11 but do not seem to be used as
they are not implemented anywhere but in X.

As GDK is not meant to fulfill window management functionality I'm going
to remove these functions without replacements.
2016-10-16 18:17:21 +02:00
Benjamin Otte
26f9b584be API: gdk: Remove gdk_screen_get_number()
It's useless everywhere but in internal X11 code.
2016-10-16 18:17:21 +02:00
Benjamin Otte
0be88cc76e API: Remove gdk_screen_get_width() and gdk_screen_get_height()
... and gdk_screen_get_width_mm() and gdk_screen_get_height_mm() and
the shortcut counterparts that call these functions on the default
screen.

Modern display servers don't provide an ability to query the size of a
screen or display so we shouldn't allow that either.
2016-10-16 18:17:21 +02:00
Benjamin Otte
579edbbca8 display: Insist that backends implement the monitor vfuncs
We cannot fallback anymore once we remove the ability to query screen
size, and that's about to happen.
2016-10-16 18:17:21 +02:00
Benjamin Otte
ed30f271f5 gdk: Insist axis.min_value < axis.max_value
Remove fallback code that would substitute screen size otherwise.
2016-10-16 18:17:21 +02:00
Benjamin Otte
2033b06cb6 gdk: Require passing screen size to translate_screen_coord() 2016-10-16 18:17:21 +02:00
Benjamin Otte
1a0a423250 API: gdk: Remove monitor APIs on GdkScreen 2016-10-16 18:17:21 +02:00
Benjamin Otte
c0276e2c5c applaunchcontext: Ignore screen name
It's guaranteed to be identical to the display name.
2016-10-16 18:17:21 +02:00
Benjamin Otte
f7cebf5c1f wayland: Use GdkMonitor APIs 2016-10-16 18:17:21 +02:00
Benjamin Otte
7232b4f735 x11: Use GdkMonitor APIs 2016-10-16 18:17:21 +02:00
Benjamin Otte
d33c251cf6 gdk: Use GdkMonitor APIs
... instead of the old ones using GdkScreen
2016-10-16 18:17:21 +02:00
Benjamin Otte
76d95c312d display: Don't return NULL in get_primary_monitor()
Nobody ever does a NULL check there so all that causes is crashes. So
we better return a non-primary monitor than NULL.

Fixes gdk-wayland always returning NULL.
2016-10-16 18:17:21 +02:00
Benjamin Otte
dcb816f99a gdk: Fix docs typo 2016-10-16 18:17:21 +02:00
Benjamin Otte
7016409e9f gdk: Get rid of unused variables 2016-10-16 18:15:37 +02:00
Olivier Fourdan
9e2b1ad39e gdkwindow: configure native windows in move_native_children()
ClutterEmbed on Wayland uses a subsurface and relocates it on configure
events, but when placed within a scrolled window, no configure event is
emitted and the ClutterEmbed subsurface remains static.

Emit a configure event for native windows in GdkWindow's internal
move_native_children() so that custom widgets relying on configure
events such as ClutterEmbed can relocate their stuff.

Similarly, when switching to/from normal/maximized/fullscreen states
which change the shadows' size and possibly shows/hides a header bar,
we need to emit a configure event even if the abs_x/abs_y haven't
changed to make sure the subsurface is size appropriately.

https://bugzilla.gnome.org/show_bug.cgi?id=771320
https://bugzilla.gnome.org/show_bug.cgi?id=767713
2016-10-13 08:53:59 +02:00