Commit Graph

1074 Commits

Author SHA1 Message Date
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
cf9b9a034b gdk: Comment out gdk_cairo_create() 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
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
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
d33c251cf6 gdk: Use GdkMonitor APIs
... instead of the old ones using GdkScreen
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
Matthias Clasen
f66a76d998 Document window-icon related api as 'may not work'
Some platforms simply don't have window icons (such as Wayland).
2016-08-24 14:43:58 -04:00
Carlos Garnacho
f1a9cd466e gdk: Address pad events similarly to keyboard events
We want the same treatment for those, the event will be emitted on the
toplevel, which will then decide what to do with the event.

It just doesn't make much sense to propagate those up/down the hierarchy,
when we want specifically one action being triggered from those.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:44 +02:00
Carlos Garnacho
0dcb9b316e gdk: Add pad event structs, enum values, and event mask bit
GDK_PAD_BUTTON*,RING and STRIP will be emitted respectively when
pad buttons, rings or strips are interacted with. Each of those
pad components belong to a group (a pad can contain several of
those), which may be in a given mode. All this information is
contained in the event.

GDK_PAD_GROUP_MODE is emitted when a group in the pad switches
mode, which will generally result in a different set of actions
being triggered from the same buttons/rings/strips in the group.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:44 +02:00
Philip Withnall
7b40fdbc21 gdkwindow: Fix potential NULL pointer dereferences in event code
The event code could potentially dereference pointer_info if the
invariant that ENTER_NOTIFY and LEAVE_NOTIFY events are only emitted on
devices which have pointers is violated elsewhere.

Found with scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2016-08-07 08:17:50 +01:00
William Hua
b3a530cb72 gdkwindow: add gdk_window_move_to_rect ()
https://bugzilla.gnome.org/show_bug.cgi?id=756579
2016-07-19 09:38:54 -04:00
William Hua
48108c401e gdkwindow: store transient_for window
https://bugzilla.gnome.org/show_bug.cgi?id=756579
2016-07-19 09:38:54 -04:00
William Hua
0a5bee2751 gdkwindow: store shadow sizes
https://bugzilla.gnome.org/show_bug.cgi?id=756579
2016-07-19 09:38:54 -04:00
Emmanuele Bassi
b5a2bba840 docs: Improve gdk_window_create_similar_image_surface()
The sizes passed are in device pixels and do not take into account the
scaling factor of the window itself. We cannot change the semantics of
the function, so let's at least add a warning for this trap door.
2016-07-11 16:55:10 +01:00
Emmanuele Bassi
222bcf1a71 gdk: Try harder at tracking drawing contexts
If gdk_cairo_create() is called within a frame draw operation, we can
still associate the Cairo context with a GdkDrawingContext.
2016-06-12 17:27:44 +01:00
Emmanuele Bassi
ddfe3374e3 Avoid a deprecation warning
Some debugging code in GdkWindow still calls gdk_cairo_create().
2016-06-09 21:00:13 +01:00
Emmanuele Bassi
ad78daaf80 gdk: Deprecate gdk_cairo_create()
We have GdkDrawingContext, now, which is in charge of creating Cairo
contexts for drawing on a GdkWindow.

https://bugzilla.gnome.org/show_bug.cgi?id=766675
2016-06-09 17:45:40 +01:00
Emmanuele Bassi
2d38c40f78 gdk: Explicitly create a cairo context inside GdkDrawingContext
Instead of using gdk_cairo_create(), which we'll soon deprecate.

https://bugzilla.gnome.org/show_bug.cgi?id=766675
2016-06-09 17:45:40 +01:00
Emmanuele Bassi
c5d0522a23 Deprecate the gdk_window_begin/end_paint family of functions
They are replaced by the more appropriate gdk_window_begin_draw_frame()
and gdk_window_end_draw_frame() functions.

https://bugzilla.gnome.org/show_bug.cgi?id=766675
2016-06-09 17:45:40 +01:00
Emmanuele Bassi
dda6a0d385 Associate the drawing context to the Cairo context
Instead of associating the GdkWindow that created the GdkDrawingContext
we can directly bind the Cairo context to the GDK drawing context.

Cairo contexts created via gdk_cairo_create() go back to not having a
GdkWindow associated to them, like they did before we introduced the
gdk_window_begin_draw_frame() API.

https://bugzilla.gnome.org/show_bug.cgi?id=766675
2016-06-09 17:45:40 +01:00
Emmanuele Bassi
a7ef37da2a Add GdkDrawingContext
Instead of giving out Cairo contexts, GdkWindow should provide a
"drawing context", which can then create Cairo contexts on demand; this
allows us to future proof the API for when we're going to use a
different rendering pipeline, like OpenGL.

https://bugzilla.gnome.org/show_bug.cgi?id=766675
2016-06-09 17:45:40 +01:00
Emmanuele Bassi
fc569f1ac6 Add frame drawing API to GdkWindow
Existing code drawing on a GDK window has to handle the direct drawing
and the buffered drawing by itself, by checking the window type and
whether or not the window is backed by a native windowing surface. After
that, the calling code has to create a Cairo context from the window and
keep an association between the context and the window itself.

This is completely unnecessary: GDK can determine whether or not it
should use a backing store to draw on a GdkWindow as well as create a
Cairo context, and keep track of it.

This allows to simplify the calling code, and enforce some of the
drawing behavior we want to guarantee to users.

https://bugzilla.gnome.org/show_bug.cgi?id=766675
2016-06-09 17:45:40 +01:00
Emmanuele Bassi
9c3802fc4b gdk: Provide safe fallback for creating GL contexts
If the backend does not override GdkWindowClass.create_gl_context()
then we should provide a fallback that gives an error, instead of
crashing.

https://bugzilla.gnome.org/show_bug.cgi?id=766782
2016-05-23 08:46:53 +01:00
Timm Bäder
f0f8d6d6b0 gdkwindow: Use GList less 2016-05-12 20:40:22 +02:00
Matthias Clasen
0f476590fb Make gdk_event_get_pointer_emulated public
There is not strong reason to keep the getter private.
At the same time, strip _-prefixes from a few other GdkEvent
APIs. Update all callers.
2016-05-10 15:16:45 -04:00
Matthias Clasen
e502702dd4 Use a variable consistently 2016-04-30 23:15:20 -04:00
Matthias Clasen
98f16fdf7a Use the new getter
This avoids the use of generic api in the per-event code path.
2016-04-30 20:59:16 -04:00
Carlos Garnacho
358d15ae5e gdk: Make GDK_TOUCH_CANCEL be dealt with similarly to GDK_TOUCH_END
We must emit the cancel event with the same semantics, and towards the GdkWindow
that is currently under the touchpoint, so make proxy_button_event() deal with
GDK_TOUCH_CANCEL.

Fixes the GDK_TOUCH_CANCEL event being emitted only on the toplevel, which is
usually non-sufficient.
2016-04-18 14:14:33 +01:00
Carlos Garnacho
6286883e8d gdk: Forward tools in client-side windows event translation 2016-04-06 15:43:29 +02:00
Alexander Larsson
4c10800bcc gdkwindow: Remove O(n-children) code in gdk_window_invalidate
When we invalidate a window we need to also invalidate all child windows
that are native (non-native are automatically invalidated as we track
invalidation once per native window only). This was done in a pretty
inefficient way, recursing over the entire tree.

This makes the invalidation much faster by only looking at the native
children of the native window we're in, filtering out those that
are not a descendant of the client side window we're interested in.
Given that there are very few native subwindows this is much faster.
2016-03-31 18:56:18 +02:00
Matthias Clasen
4d84e7a8f7 Trivial formatting fix 2016-03-11 21:42:33 -05:00
Paolo Borelli
807c0c0a56 gdkwindow: get the pointer device from the default seat
https://bugzilla.gnome.org/show_bug.cgi?id=762820
2016-02-29 14:05:00 +01:00
Matthias Clasen
1c887b2287 gdk: Strip newlines from g_warning and g_error
g_logv adds one for us already.
2016-02-28 12:23:12 -05:00
Paolo Borelli
72b40266bd gdkwindow: cleanup, avoid direct access to display members 2016-02-28 18:22:42 +01:00
Peter Hutterer
48aa1bb08f wayland: add gdk_event_is_scroll_stop_event()
And use it to handle kinetic scrolling in the GtkScrolledWindow.

However, dropping the delta check causes the X11-based kinetic
scroll to break since we don't have the stop event here. Correct handling of
xf86-input-libinput-based scroll events is still being discussed.

https://bugzilla.gnome.org/show_bug.cgi?id=756729
2016-01-18 21:36:23 +01:00
Carlos Garnacho
50859d9efe GdkWindow: Add a few ignore deprecations statements around GdkDeviceManager
There's places where we still need to deal with floating devices, which are
unseen by seats. Ignore deprecations and keep using GdkDeviceManager until
we can forget about floating devices.
2015-12-16 19:47:06 +01:00
Carlos Garnacho
ce7bb7c739 GdkWindow: Iterate through seats' pointers/keyboards in older grab functions
Instead of using the GdkDeviceManager.
2015-12-16 19:47:05 +01:00
Carlos Garnacho
c70da9b7ae gdk: Set seat on events generated in common code 2015-12-16 19:47:05 +01:00
Carlos Garnacho
ee549c9ded GdkWindow: Listen to ::seat-removed in order to remove pointer info
Our actions on ::device-removed only actually applied to master
pointers, so listening to GdkDisplay::seat-removed and operating
on the seat pointer is equivalent.
2015-12-15 23:22:00 +01:00
Carlos Garnacho
b4aa498fe7 GdkWindow: Iterate through seats in gdk_window_set_cursor()
And set the pointer on all seat pointers, equivalent to the master
pointer lookup we were performing with GdkDeviceManager
2015-12-15 23:20:40 +01:00
Carlos Garnacho
ff686344c9 GdkWindow: Avoid gdk_device_manager_get_client_pointer()
It's now deprecated
2015-12-15 23:19:49 +01:00
Carlos Garnacho
fc19a999ec gdk: Manage GDK_TOUCH_CANCEL events on gdk_windowing_got_event()
These events must get active/implicit grabs undone, and can be done
on client-side code.

https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:40:21 +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
Alexander Larsson
09a181d205 gdk: Fix invalidation w/ pixel cache when changing child window geometry.
When moving/scrolling a child window we can't use the current clip
region to limit what is invalidated, because there may be a pixel
cache that listens for changes outside the clip region. Instead
invalidate the entire area and rely on the invalidation code to limit
the repaint to the actually visible area.
2015-11-09 17:06:00 +01:00
Matthias Clasen
ffa98cbfa5 Don't use g_slist_next in gdk
We generally just use ->next directly.
2015-10-20 06:14:57 -04:00
Matthias Clasen
65ec902df9 Remove overhead in gdk_window_get_user_data
This function is called very frequently during in GTK+'s drawing
paths, and thus should not carry unexpected costs.
2015-09-28 06:29:50 -04:00
Alexander Larsson
ee883a2ef5 gdkwindow: Fix list_insert_link_before
We forgot to set prev->next to the new link
2015-09-21 16:59:51 +02:00
Christian Hergert
1c8760c5fa gdkwindow: avoid multiple walking of children list
This counts the number of children and fetches the last GList
node at the same time.
2015-09-14 12:40:12 -07:00
Alexander Larsson
eafedfbaf8 gdkwindow: Avoid list allocation and object refs during repaint
There is no need to ref the windows we're ignoring, so collect and ref
only the affected child windows. Also, use a on-stack array rather
than allocating a linked list.

Also, we don't need to ref during the event emissions too, as we
already hold a ref.

https://bugzilla.gnome.org/show_bug.cgi?id=754687
2015-09-14 11:01:13 +02:00
Alexander Larsson
ea294fd92c gdkwindow: Store children list nodes in GdkWindow structure
This avoids a bunch of allocations, and additionally it has better
cache behaviour, as we don't follow pointers to the separate GList
node memory areas during traversal.

From Christian Hergert:

  This machine is a Retina mac book pro so I've been working on getting
  GtkTextView (GtkPixelCache) up to our performance level on
  X11/Wayland. I'm seeing a jump from about 43 FPS to about 50 FPS.

https://bugzilla.gnome.org/show_bug.cgi?id=754687
2015-09-13 21:48:55 +02:00
Matthias Clasen
2e52310d4b gdk window: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:13:14 -04:00
Matthias Clasen
60c1dbd358 gdk window: Remove an unneeded variable
The G_DEFINE_TYPE macros automate the parent_class handling.
2015-09-06 17:11:33 -04:00
Matthias Clasen
dc79d4f50d Trivial formatting fix 2015-08-28 16:15:26 -04:00
Carlos Garnacho
5092febaf8 gdk: Proxy touchpad events through the client-side window hierarchy
This includes poking the deepmost window, checking for the
GDK_TOUCHPAD_GESTURE_MASK bit set, and translating coordinates in events
accordingly.
2015-08-12 23:20:24 +02:00
Carlos Garnacho
8c2b3930da gdk: Add GDK_TOUCHPAD_GESTURE_MASK to GdkEventMask
Users will need to manually select on this in order to receive gesture
events.
2015-08-12 23:20:24 +02:00
Jeremy Whiting
f9d903995d Added api to set a window to fullscreen on a given monitor.
https://bugzilla.gnome.org/show_bug.cgi?id=752677
2015-07-25 07:08:59 -06:00
Matthias Clasen
bb29c1fcc5 gdk: Add some parameter checking
This may help coverity recognize that we're not called with
invalid combinations.
2015-07-17 18:37:20 -04:00
Matthias Clasen
23ce2562bf Fix up doc comments 2015-06-23 17:27:42 -04:00
Ting-Wei Lan
3955d93e9d Fix return value error in gdk_window_set_pass_through
https://bugzilla.gnome.org/show_bug.cgi?id=751099
2015-06-17 21:36:35 +08:00
Christian Hergert
213b92e644 gdkwindow: avoid updating background pattern if it matches previous
Background patterns are often updated when style changes. In many cases,
the new pattern will match the previous. We can optimize out the
invalidation that will occur upon resetting the same pattern.
2015-06-16 14:40:09 -07:00
Alexander Larsson
4c3eece663 gdk: Add gdk_window_set_pass_through
An pass_through window is something you can draw in but does not
affect event handling. Normally if a window has with no event mask set
for a particular event then input events in it go to its parent window
(X11 semantics), whereas if pass_through is enabled the window below
the window will get the event. The later mode is useful when the
window is partially transparent. Note that an pass-through windows can
have child windows that are not pass-through so they can still get events
on some parts.

Semantically, this behaves the same as an regular window with
gdk_window_set_child_input_shapes() called on it (and re-called any
time a child is changed), but its far more efficient and easy to use.

This allows us to fix the testoverlay input stacking test.

https://bugzilla.gnome.org/show_bug.cgi?id=750568

https://bugs.freedesktop.org/show_bug.cgi?id=90917
2015-06-15 10:56:45 +02:00
Matthias Clasen
577e9a33bb Remove an unused variable 2015-06-13 21:10:25 -04:00
Ting-Wei Lan
41b6993a66 Fix 'void function should not return void expression' warning for clang
https://bugzilla.gnome.org/show_bug.cgi?id=750888
2015-06-13 23:00:23 +08:00
Руслан Ижбулатов
1432d23e98 Fix use-after-free in gdk_window_end_paint()
It's a miracle that this code ever worked.
2015-04-30 20:43:18 +00:00
Matthias Clasen
5a643f19c5 Improve the docs for gdk_window_set_opaque_region
Fix several typos and annotate the region parameter
as allow-none.
2015-04-18 12:54:45 -04:00
Philip Withnall
586240d2f8 gdkwindow: Fix potential NULL pointer dereference
gdk_window_ensure_native() can end up with a NULL parent pointer, which
it passes to find_native_parent_above()…but that expects a non-NULL
parent.

Found with scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-09 13:41:37 +00:00
Philip Withnall
09bb109f01 docs: Expand input handling documentation to cover event masks
Also try and clarify a few things about event propagation. Move
input-handling.xml into gtk-doc’s expand_content_files variable so it
automatically links to widget documentation. Add links from
gtk_widget_add_events() and friends to the new documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=744054
2015-02-19 12:48:42 +00:00
Paolo Borelli
f4510c93b7 Do not use "return" when chaining up to a void function 2015-02-17 14:54:51 +01:00
Emmanuele Bassi
022724aa69 gl: Drop profile for gdk_window_create_gl_context()
Now that we have a two-stages GL context creation sequence, we can move
the profile to a pre-realize option, like the debug and forward
compatibility bits, or the GL version to use.
2015-02-12 12:34:28 +00:00
Emmanuele Bassi
4b8b3b431b gl: Drop OpenGL legacy profile
We simply don't want to care about legacy OpenGL.

All supported platforms also have support for OpenGL ≥ 3.2; it would
complicate the internal code; and would force us to use legacy GL
contexts internally if the first context created by the user is a legacy
GL context, and disable creation of core-3.2 contexts after that.

We will need to fix all our code examples to use the Core 3.2 profile.

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:30 +00:00
Emmanuele Bassi
22e6f37c9c GL: Split GL context creation in two phases
One of the major requests by OpenGL users has been the ability to
specify settings when creating a GL context, like the version to use
or whether the debug support should be enabled.

We have a couple of requirements in terms of API:

 • avoid, if at all possible, the "C arrays of integers with
   attribute, value pairs", which are hard to write and hard
   to bind in non-C languages.
 • allow failing in a recoverable way.
 • do not make the GL context creation API a mess of arguments.

Looking at prior art, it seems that a common pattern is to split the
construction phase in two:

 • a first phase that creates a GL context wrapper object and
   does preliminary checks on the environment.
 • a second phase that creates the backend-specific GL object.

We adopted a similar pattern:

 • gdk_window_create_gl_context() creates a GdkGLContext
 • gdk_gl_context_realize() creates the underlying resources

Calling gdk_gl_context_make_current() also realizes the context, so
simple GL users do not need to care. Advanced users will want to
call gdk_window_create_gl_context(), set up the optional requirements,
and then call gdk_gl_context_realize(). If either of these two steps
fails, it's possible to recover by changing the requirements, or simply
creating a new GdkGLContext instance.

https://bugzilla.gnome.org/show_bug.cgi?id=741946
2015-02-09 19:10:04 +00:00
Matthias Clasen
31d3be96e4 Be safe against stray booleans
Since gboolean is a typedef for int, the compiler won't complain
about gdk_window_set_event_compression (w, 2). So, make it work.

https://bugzilla.gnome.org/show_bug.cgi?id=742566
2015-02-01 17:30:10 -05:00
Matthias Clasen
561ff51abb Fix an oversight
Commit ff256956b2 introduced a frame_clock_events_paused
flag, but only ever set it to TRUE, instead of unsetting it when
events are resumed. This was leading to assertion failures in
_gdk_display_unpause_events().
2015-01-30 18:42:06 -05:00
Tom Hughes
ff256956b2 Resume events when disconnecting from a frame clock
If we are disconnecting from a frame clock that has paused event
processing and hasn't issued a resume yet make sure we resume the
events or they will stay blocked forever.

https://bugzilla.gnome.org/show_bug.cgi?id=742636
2015-01-30 17:32:58 -05:00
Niels Nesse
00834786be GDK GL context's should associate with "window->impl_window" not "window"
In some layouts this inconsistency results in crashes in
gdk_gl_texture_from_surface() since it uses gdk_gl_context_get_window() but
the returned window is not the same as the one that is being painted so
"window->current_paint.surface" is NULL. I saw this problem when packing a
GdkGLArea into a GtkPaned.

https://bugzilla.gnome.org/show_bug.cgi?id=743146
2015-01-28 12:00:30 +00:00
Niels Nesse
27cf0fa34c Fix core context creation in GdkGLContext
- Specifically request GL version when creating context. Just specifying core
profile bit results in the requested version defaulting to 1.0 which causes
the core profile bit to be ignored and an arbitrary compatability context to be
returned.

- Fix GL painting by removing GL calls that have been depricated by the 3.2 core
profile.

- Additionally remove glInvalidateFramebuffer() call, it is not supported by 3.2
core.

https://bugzilla.gnome.org/show_bug.cgi?id=742953
2015-01-28 12:00:30 +00:00
Matthias Clasen
b6551c84c9 Initialize variables
No need to risk valgrind complaints about initialized
values.

https://bugzilla.gnome.org/show_bug.cgi?id=743422
2015-01-24 16:45:04 -05:00
Matthias Clasen
47e5e1c72d Fix a typo in the docs
https://bugzilla.gnome.org/show_bug.cgi?id=743037
2015-01-18 15:26:49 -05:00
Matthias Clasen
cf277fabb5 Remove some outdated references
We shouldn't recommend gtk_widget_modify_bg() or
gtk_style_set_background() anymore.
2015-01-18 12:41:07 -05:00
Jasper St. Pierre
3f0c84f7ad gdkwindow: Clean up whitespace slightly
This has been bothering me for a while.
2014-11-22 08:12:22 -08:00
Jasper St. Pierre
8976e84ded gdkwindow: Don't pass the region to the impl when beginning a paint
It's unused. At the same time, rename "begin_paint_region" to
"begin_paint". This will help us clean up how GDK painting works
in the future to allow more creative use of double-buffering.
2014-11-22 08:08:34 -08:00
Alexander Larsson
1eb3b34bce Add gdk_window_get_unscaled_size
This is required for the X backend GL integration. If the
window has a height that is not a multiple of the window scale
we can't properly do the y coordinate flipping that GL needs.
Other backends can ignore this and use the default implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=739750
2014-11-20 12:38:04 +01:00
Matthias Clasen
d9b02ea4a3 gdk: Make debug-updates a per-display setting
Add private API to set this per-display, and make the existing
gdk_window_set_debug_update function set a global default.
2014-11-10 15:23:14 -05:00
Matthias Clasen
8338b7e4cd Move rendering mode into GdkDisplay
This is in preparation for making it runtime-settable in the
inspector.
2014-11-10 14:28:43 -05:00
Javier Jardón
710f332082 configure.ac: Depend on cairo 1.14.0
This is needed for cairo_set_device_scale()
2014-11-10 15:12:17 +00:00
Alexander Larsson
90555e06be gdk_window_end_paint: Flush destination surface after paint
It seems in cairo 1.14 we need this after having painted an image surface
to a X11 window surface (i.e. with GDK_RENDERING=image).
2014-11-10 15:25:31 +01:00
Emmanuele Bassi
cdcd3ca359 Hide GdkWindow libgtk_only API in the private vtable
These are the last two global GDK symbols that have a libgtk_only
suffix.

https://bugzilla.gnome.org/show_bug.cgi?id=739781
2014-11-08 00:20:15 -05:00
Emmanuele Bassi
585af218a3 Move GDK GL flags accessors to the private vtable
This allows us to use the GDK_PRIVATE_CALL macro inside gtk.

https://bugzilla.gnome.org/show_bug.cgi?id=739781
2014-11-08 00:20:15 -05:00
Matthias Clasen
5d0d1e524e Export API to set GL flags
This will be used in the inspector.
2014-11-06 23:29:16 -05:00
Alexander Larsson
41bf293efd GdkWindow: Drop gl matrix setup which is not needed anymore. 2014-11-06 20:37:24 +01:00
Alexander Larsson
1f3f933edf GdkX11GLContext: Use bitblit for swap if no buffer age support
If buffer age is undefined and the updated area is not the whole
window then we use bit-blits instead of swap-buffers to end the
frame.

This allows us to not repaint the entire window unnecessarily if
buffer_age is not supported, like e.g. with DRI2.
2014-11-06 12:24:43 +01:00
Alexander Larsson
90a5fa80af Add GDK_GL env var and GdkGLFlags
This moves the GDK_ALWAYS_USE_GL env var to GDK_GL=always.
It also changes GDK_DEBUG=nogl to GDK_GL=disable, as GDK_DEBUG
is really only about debug loggin.

It also adds some completely new flags:

 software-draw-gl:
   Always use software fallback for drawing gl content to a cairo_t.
   This disables the fastpaths that exist for drawing directly to
   a window and instead reads back the pixels into a cairo image
   surface.

 software-draw-surface:
   Always use software fallback for drawing cairo surfaces onto a
   gl-using window.  This disables e.g. texture-from-pixmap on X11.

 software-draw:
   Enables both the above.
2014-11-06 12:24:43 +01:00
Alexander Larsson
9372cbdbf8 GdkWindow: Try to use a Core 3.2 GL profile for the paint context
If this is supported we avoid a lot of legacy baggage which we don't
need.
2014-11-06 12:24:43 +01:00
Alexander Larsson
5f14630b76 GdkWindow: destroy paint gl context on destroy 2014-10-30 12:43:03 +01:00
Matthias Clasen
3f1dc87188 Plug another memory leak
Also found by valgrind.
2014-10-28 16:07:57 -04:00