Commit Graph

9624 Commits

Author SHA1 Message Date
Matthias Clasen
5a77994516 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2760
2020-10-29 18:55:53 +00:00
Matthias Clasen
ce78d0c301 docs: Tweak GdkToplevel docs 2020-10-29 14:23:46 -04:00
Matthias Clasen
94305f248b docs: Tweak GdkPopup docs 2020-10-29 14:23:46 -04:00
Matthias Clasen
3afd5d7a89 docs: Tweak GdkSurface docs
Add more details, and refer to the GdkToplevel / GdkPopup
docs.
2020-10-29 14:23:46 -04:00
Matthias Clasen
d2adbad408 docs: Tweak frame clock docs 2020-10-29 14:23:46 -04:00
Matthias Clasen
2df382277d docs: Small additions for GdkCursor docs 2020-10-29 14:23:46 -04:00
Matthias Clasen
9f71bdd045 docs: Cosmetics
Make the GdkRGBA heading less repetitive.
2020-10-29 14:23:46 -04:00
Matthias Clasen
838d0924b9 docs: Tweak GdkPaintable docs
Minor additions here and there.
2020-10-29 14:23:46 -04:00
Matthias Clasen
1f8d593931 docs: Add some detail to GdkTexture docs
Minor additions here and there.
2020-10-29 14:23:46 -04:00
Matthias Clasen
574a3a456d gdk: Drop GdkPoint from the api
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.
2020-10-29 14:23:46 -04:00
Matthias Clasen
3617fbab42 docs: Include GDK_WINDOWING_MACOS
We no longer have a Quartz backend, it is called
MacOS now.
2020-10-29 14:23:46 -04:00
Matthias Clasen
29ccd13e15 docs: Stop referring to the Quartz backend
Its MacOS now.
2020-10-29 14:23:46 -04:00
Christian Hergert
de9c9efa6f macos: implement GL context
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.
2020-10-29 10:57:02 -07:00
Christian Hergert
eb809ba425 macos: tweak gravity while resizing
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.
2020-10-29 10:57:02 -07:00
Christian Hergert
adf60fb3a1 macos: be tolerant of NULL GL context
Some code appears to unconditionally attempt to make the context current,
so this makes things tolerant to a NULL GdkGLContext and just return FALSE.
2020-10-29 10:57:02 -07:00
Christian Hergert
0040667965 macos: remove unused GL layer
This isn't being used, and instead we'll go the route of a NSView for
the OpenGL implementation.
2020-10-29 10:57:02 -07:00
Christian Hergert
60e67a62e6 macos: move setNeedsDisplay helper to GdkMacosCairoView
This isn't needed in the base class, which will eventually get a GL subclass.
2020-10-29 10:57:02 -07:00
Christian Hergert
524fbc35a7 gl: remove unused texture_from_surface API
This is not used anywhere and only exists within the X11 backend. It
can be removed now.
2020-10-29 08:26:27 -07:00
Matthias Clasen
51d35750f6 Cosmetics
Whitespace fix.
2020-10-29 07:40:30 -04:00
Matthias Clasen
d5b9489408 Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master

Closes #3282

See merge request GNOME/gtk!2755
2020-10-27 22:38:58 +00:00
Matthias Clasen
c5ed5c5ff9 gdk: Deliver queued events on flush
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.
2020-10-23 17:03:00 -04:00
Timm Bäder
b1664534af gdksurface: Ensure some assumptions
Just to please scan-build
2020-10-22 17:46:34 +02:00
Christian Hergert
eb82b2a9ca macos: fix discovery of surface under pointer 2020-10-19 12:35:41 -07:00
Xavier Claessens
be8246a6cb gdkglcontext: Fix build with MSVC
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.
2020-10-19 09:17:53 -04:00
Sophie Herold
cd0bef9390 Add some missing nullable return annotations 2020-10-17 15:32:36 +02:00
Christian Hergert
7ae8ed82c9 macos: fix fps calculation for frame timings
We need to mark the timings as complete after adding the
presentation time so that we have a valid FPS for the overlay
widget and/or fishbowl demo.
2020-10-15 21:04:51 -07:00
Chun-wei Fan
2cc650ced2 gdk/Win32: Fix mouse pointer capture
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
2020-10-16 10:03:50 +08:00
Руслан Ижбулатов
6a0c181886 GDK W32: Remove stacking functions
Stacking functions enforce non-native stacking behaviour that is
mostly unneeded, and doing so introduces bugs and complicates things.
2020-10-16 10:02:57 +08:00
Руслан Ижбулатов
89286af620 Revert "GDK W32: Use SWP_NOOWNERZORDER everywhere it can be applied"
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.
2020-10-16 10:01:46 +08:00
Chun-wei Fan
bc142b9c43 GDK/Win32: Fix modal window handling
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.
2020-10-16 09:56:42 +08:00
Matthias Clasen
bf58b6f88c Merge branch 'ebassi/for-master' into 'master'
GdkWayland API cleanups

Closes #3249

See merge request GNOME/gtk!2688
2020-10-15 16:55:19 +00:00
Matthias Clasen
1d40f29776 wayland: Make gdk_wayland_device_pad_set_feedback private
It is not a generally useful api, and awkwardly named.
2020-10-15 12:00:00 -04:00
Jonas Ådahl
7dfb25f124 wayland/surface: Clear has_uncommitted_ack_configure when hiding
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
2020-10-15 14:56:06 +02:00
Christian Hergert
6e84c7c59e macos: fix discover of surface under cursor
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.
2020-10-14 16:59:38 -07:00
Christian Hergert
0af3d21573 macos: only emit popup-layout-changed after initial present
Otherwise we risk being re-entrant where GtkPopover will not have a
GdkPopupLayout causing other issues.
2020-10-14 16:28:44 -07:00
Christian Hergert
e089bba4f5 macos: ensure we have access to a GdkMonitor 2020-10-14 16:28:44 -07:00
Christian Hergert
b462bc35c0 macos: allow pointer release event outside surface coords
This helps with grab situations so that we can end it when releasing
the pointer buttons outside of the window coordinates.
2020-10-14 15:45:50 -07:00
Christian Hergert
d700cfa2ef macos: break grabs after sending release event 2020-10-14 15:45:50 -07:00
Christian Hergert
cdb2c1698c macos: dont send crossing events during grab
Fixes an issue where we can't drag scrollbars or text selections while
outside of the application window.
2020-10-14 15:45:50 -07:00
Matthias Clasen
85394b04e0 Merge branch 'wip/chergert/gdk-macos-fixes' into 'master'
GTK4: fix macos device state query for surfaces

See merge request GNOME/gtk!2690
2020-10-14 19:10:11 +00:00
Timm Bäder
9698cd67a1 gdkgl: Remove flipping when downloading GL texture
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.
2020-10-14 15:06:12 -04:00
Timm Bäder
d4efb5b738 gdkgl: Stop getting the clip region from cairo
Unused
2020-10-14 15:06:12 -04:00
Timm Bäder
904772c719 gdkgl: Rename function
This returns the name of the shader type.
2020-10-14 15:06:12 -04:00
Timm Bäder
9f574a596f gdkgl: Remove unused cairo_get_matrix() call 2020-10-14 15:06:12 -04:00
Emmanuele Bassi
fe871f9d46 Add type annotations for GdkWayland API
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.
2020-10-14 15:06:12 -04:00
Emmanuele Bassi
40e4f3758e Skip GdkWayland symbols that use wayland-client types
The wayland-client API does not have introspection annotations, so we
can't use these types anyway.
2020-10-14 15:06:12 -04:00
Christian Hergert
9279c2cbd1 gdk: remove quartz subdirectory from backends 2020-10-14 15:06:12 -04:00
Christian Hergert
aed279ed4e macos: add key equivalent helper
This is needed by quartz code in gtk/.
2020-10-14 15:06:12 -04:00
Christian Hergert
cc2e69cbd8 macos: remove workaround for scroll delta
This gets handled differently in gtk/ and so we shouldn't translate it here.
2020-10-14 15:06:12 -04:00
Christian Hergert
ff279d03b2 macos: track various changes in GDK 2020-10-14 15:06:12 -04:00