We can just call gdk_surface_invalidate_rect here
like we do elsewhere in gdk, and I'm a bit uncertain
about the current code that adds an empty update
region.
The Cairo implementation for the Macos backend uses a toplevel
window with full transparency and a series of NSView to create opaque
regions. This improves compositor performance because it allows the
display server to avoid costly blends.
However, we want to ensure we clip better when exposing the
transparent region so that we only expose the shadows/corners as
necessary.
This typedef was not used in any public APIs, and is
only used in the MacOS backend. It is not worth preserving
as public API, move it to the only user.
This implements the basics for a GdkGLContext on macOS. Currently, rendering
only is fully working for the GskCairoRenderer case where we read back pixels
into a cairo surface for rendering. More work on synchronization is required for
the GL on GskGLRenderer case.
When we attempt to render a surface itself with GL, the context will ensure that
the new GdkMacosGLView is placed within the NSWindow. In other cases, we
use a dummy NSView and NSWindow for backing the NSOpenGLContext to
ensure that we can get accelerated drawing.
This gets GtkGLArea working when running with GSK_RENDERER=cairo.
This helps a situation where the window contents has not changed
in time for a drawing. Setting the texture gravity helps that side or
corner to be less jittery while moving.
Ideally, we can get to a point where we are synchronized and keeping
up with drawing fast enough to not need this. That may require some
work to drive frame clocks from drawRect: though.
The current code was marking queued events as flushed,
but left them in the queue. That doesn't make sense to
me - we should deliver all events we have before we
reach the paint phase of the frame cycle.
GLDEBUGPROC callback is defined with APIENTRY which is a windows
specific calling convention. That macro expands to nothing when building
on other platforms.
Fixes: #3268.
Call SetCapture() explcitly for the (new) modal window so that we make the
modal window respond to mouse input, and also call SetCapture() to the parent
of the transient window that we are destroying so that mouse input capture is
returned to the parent window.
This attempts to fix the following:
* Upon creating a new modal window, the new modal window does not receive
pointer input unless one switches to another program and back
* Upon closing a transient window, the parent window that activated the
transient window does not receive pointer input unless one switches to
another and back
This reverts commit fc2008f2.
Turns out, we *don't* have code to maintain Z-order. Restacking
code is not doint that, it just enforces a few weird Z-order-related
behaviours.
Make sure that we get the state of the modal window properly, and send out the
corresponding notification signals.
This will ensure that we do not try to activate windows that should have become
inactivated due to it opening modal windows and render the program unresponsive
because we are not activating the correct window that is due to receive user
input.
The 'has_uncommitted_ack_configure' state was added to make sure we're
responding to 'xdg_surface.configure' events with
'xdg_surface.ack_configure' requests, as is necessary according to spec.
What we didn't do was to clear this state when hiding, meaning that if
we hid the surface after a configure event, but before the frame
finished and we processed the 'has_uncommitted_ack_configure', we'd try
to acknowledge the surface configuration after having destroyed the
surface.
Closes: #3262
This was incorrectly reporting the toplevel surface instead of the
popup surface that was placed above it. This fixes event delivery
to popups for selecting menu items and more.
This fix is correct and fixes:
1) GL textures being upside down in the inspector. They are getting
downloaded because they've been created in a different GL context
2) GL textures being upside down in the cairo renderer (same reason)
However, it breaks the testsuite. We do the flipping via the projection
matrix, but most of the shaders don't care about that.
The GdkWayland API takes generic GDK types and performs a run time
check, which means we need to properly annotate the actual expected
type in order to have methods recognised as such.
When querying a device, we need to ensure we are providing coordinates
in the coordinate system of the surface. Further, we need to actually
provide the button and keyboard state.
This fixes some issues related to dragging scrollbars and selecting list
box rows more reliably.
The GdkWayland API takes generic GDK types and performs a run time
check, which means we need to properly annotate the actual expected
type in order to have methods recognised as such.
No users of gdk_display_peek_event, gdk_display_has_pending
_gdk_display_event_data_copy or _gdk_display_event_data_free,
so drop all of these, and related vfuncs.
Go back to installing our debug message callback
unconditionally if G_ENABLE_CONSISTENCY_CHECKS is
defined, and allow opting into it using GDK_DEBUG=gl-debug
otherwise.
Prevents GDK Popups from stealing focus from the parent window when
using Server Side Decorations on win32.
It uses `ShowWindow` and the `SW_SHOWNOACTIVATE` flag.
When using the saved size because the compositor
told us to, we were forgetting to readd the margins.
The visible symptom of this was the window getting
smaller every time we went to tiled state and back.
Don't remember the surface size when we are in tiled
state either. This matches the 'fixed_size' condition
in gdk_wayland_surface_configure_toplevel.
This change fixes an issue where moving a window first
to tiled, then to maximized state and back would lead
to the unmaximized window having the tiled dimensions.
We should not emit configure events before we are realized - size
changes at this point are not relevant.
This gets rid of a mysterious emission of GdkSurface::size-changed
with a size of 52x52, that is happening when GtkWindow sets the
shadow_width before the window is mapped.
Always install the debug message callback when we can
and GDK_DEBUG=gl-debug is specified. Previously, we
were only installing the callback when the build was
a non-optimized debug build.
If all your callers already initialize the array element as needed,
then we don't need to memset it to zero first.
This is pretty useful for the snapshot state stack, because due
to the per-node-type data area the elements on the stack are
quite large, but often a lot of it is not used.
This inlines the splice and reserver GdkArray calls. These are
typically only called from the gdk_array_(append/set_size) functions
anyway, and inlining the caller means we can constant propagate the
constant arguments in those calls. Its hard to get exact numbers, but
in fishbowl i noticed a significant decrease in the time spent in
the array code when pushing and poping states.
There is nothing really special about this code, its just a helper for
uploading pixel data to opengl, and we're not really in the business
of doing opengl-specific helper functions.