summaryrefslogtreecommitdiff
path: root/gdk/gdksurface.c
Commit message (Collapse)AuthorAgeFilesLines
* gdk: Add missing g-i annotations for gdk_surface_translate_coordinatesricotz/for-masterRico Tzschichholz2021-01-251-2/+2
|
* Merge branch 'surface-scale' into 'master'Matthias Clasen2021-01-171-0/+12
|\ | | | | | | | | | | | | Surface scale Closes #3578 See merge request GNOME/gtk!3085
| * surface: Add a scale-factor propertyMatthias Clasen2021-01-161-0/+12
| | | | | | | | This will allow us to notify when the scale changes.
* | docs: Remove a reference to configure eventsMatthias Clasen2021-01-161-2/+1
|/ | | | Those don't exist anymore.
* Add a doc comment for gdk_surface_request_layoutMatthias Clasen2020-12-151-0/+7
|
* gdk/surface: Trigger motion check for next frame after thawCarlos Garnacho2020-12-121-20/+21
| | | | | | | | This is a more reliable calling point than ::resume-events, and a good one to schedule things so they happen on a frame clock in no special phase (Thus still fixing the original issue at 80d4a08e30) Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3461
* gdk/surface: Delay gdk_surface_request_motion() requests internallyCarlos Garnacho2020-12-081-6/+22
| | | | | | | | | | | | | | Those requests are received while dealing with the ::layout frame clock phase, this has the unintended side effect of making the frame clock "rewind" to handle ::flush-events again during this frame, which delays everything and practically halves the frame rate. We do intend to make the motion events dispatches on the next frame, so do this in an idle at a slightly lower priority than layout/draw, so the ::flush-events phase is actually requested for the next frame. Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3264
* gdk: Replace 'WITHDRAWN' state with async 'is-mapped' booleanJonas Ådahl2020-12-071-18/+72
| | | | | | | | | | | | | | | | | | | It was used by all surfaces to track 'is-mapped', but still part of the GdkToplevelState, and is now replaced with a separate boolean in the GdkSurface structure. It also caused issues when a widget was unmapped, and due to that unmapped a popover which hid its corresponding surface. When this surface was hidden, it emitted a state change event, which would then go back into GTK and queue a resize on popover widget, which would travel back down to the widget that was originally unmapped, causing confusino when doing future allocations. To summarize, one should not hide widgets during allocation, and to avoid this, make this new is-mapped boolean asynchronous when hiding a surface, meaning the notification event for the changed mapped state will be emitted in an idle callback. This avoids the above described reentry issue.
* gdk/surface: Allow inhibit layout from backendJonas Ådahl2020-12-071-1/+4
| | | | | | If compute_size() returns TRUE, the layout will not be propagated to GTK. This will be used by the X11 backend to queue asynchronous resizes that shouldn't yet allocate in GTK.
* gdk/surface: Emit layout event while frozenJonas Ådahl2020-12-071-10/+0
| | | | | | The allocation of popups are part dependent of the allocation of the root, which means the root must still be allocated when updates are frozen, otherwise we'll try to allocate non-laid out popups.
* gdk: Remove GdkSurface::size-changedJonas Ådahl2020-12-071-33/+0
| | | | | It's not emitted, and everyone should use the GdkSurface::layout signal from now on.
* gdk: Replace all GDK_CONFIGURE usage with GdkSurface::layoutJonas Ådahl2020-12-071-24/+4
| | | | | | This removes the GDK_CONFIGURE event and all related functions and data types; it includes untested changes to the MacOSX, Win32 and Broadway backends.
* gdk: Always get shadow width via GdkToplevelSizeJonas Ådahl2020-12-071-53/+10
| | | | | | | | This removes the gdk_surface_set_shadow_width() function and related vfuncs. The point here is that the shadow width and surface size can now be communicated to GDK atomically, meaning it's possible to avoid intermediate stages where the surface size includes the shadow, but without the shadow width set, or the other way around.
* gdk/surface: Try to reschedule pending phase until dispatchedJonas Ådahl2020-12-071-4/+4
| | | | | | | If a surface scheduled a relayout, got frozen, and a layout phase happened, then got unfrozen, it wouldn't see it's layout being requested; avoid this race by remembering the pending phases until they actually happened.
* gdk/surface: Make backends aware of when layout is requestedJonas Ådahl2020-12-071-0/+5
|
* gdk/surface: Remove left-over signal enum valueJonas Ådahl2020-12-071-1/+0
| | | | | The popup-layout-change signal was moved to GdkPopup, but the enum was never removed from GdkSurface.
* gdk/frame-clock: Remove the newly added 'compute-size' phaseJonas Ådahl2020-12-071-19/+0
| | | | | What was previously done in the layout phase is now done in response to a GdkSurface signal, which means size computation can happen on layout.
* wayland/surface: Compute size on layoutJonas Ådahl2020-12-071-0/+5
| | | | | Stop using the 'compute-size' phase of the frame clock, use the layout phase instead, now that GTK isn't using the layout phase anymore.
* Pass the layout signal via GdkSurface to GtkRootJonas Ådahl2020-12-071-0/+46
| | | | | | Don't have GtkRoot listen directly to the layout signal on the frame clock, but let it pass through GdkSurface. This will allow GdkSurface to be more involved in the layout phase.
* gdk/surface: Make pending schedule a phase enumJonas Ådahl2020-12-071-11/+7
| | | | | | Scheduling an update when frozen would reschedule when unfrozen; change this to a generic pending phase enum, and use this for resrcheduling paint and compute-size.
* gtk/root: Validate css node after updateJonas Ådahl2020-12-071-0/+26
| | | | | It should happen before layout, but after the animation tick, thus after the update.
* gdk/surface: Add API to request 'compute-size' clock phaseJonas Ådahl2020-12-071-1/+25
|
* gdk/surface: Use helper to emit 'size-changed' signalJonas Ådahl2020-12-071-2/+10
|
* gtk/window: Let the backend handle toplevel freezingJonas Ådahl2020-12-071-20/+0
|
* surface: Only keep state 'withdrawn' after hidingJonas Ådahl2020-12-071-1/+3
| | | | | A hidden surface should start from a clean slate when showing again, so clear any now out of date state.
* gdk/surface: Add API to queue and apply state changesJonas Ådahl2020-12-071-1/+32
| | | | | This will be used to compress state changes and apply as part of a frame clock dispatch.
* Revert "Simplify gdk_surface_queue_render"Christian Hergert2020-11-041-1/+5
| | | | This reverts commit 2120e9df880cabfe21d5a4e8c2d0e6804a4e09d8.
* CosmeticsMatthias Clasen2020-11-041-2/+0
| | | | Extraneous pair of parens snuck in with 2120e9df88.
* surface: Be smarter about autohideMatthias Clasen2020-11-041-14/+12
| | | | | | | | | When we close grabbing popups due to an outside click, check at each level if the click is still outside. This makes closing the nested popover menu in the popover on page 3 of widget-factory work as expected, when you click the menubutton again.
* surface: Be more lenient for autohideMatthias Clasen2020-11-041-1/+4
| | | | | | When an event happens on a non-grabbing popup that hangs off a grabbing popup, don't trigger the autohide. This makes touch text handles work inside the popover on page 3 of widget-factory.
* Simplify gdk_surface_queue_renderMatthias Clasen2020-11-031-5/+3
| | | | | | | 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.
* docs: Tweak GdkSurface docsMatthias Clasen2020-10-291-2/+9
| | | | | Add more details, and refer to the GdkToplevel / GdkPopup docs.
* gdksurface: Ensure some assumptionsTimm Bäder2020-10-221-0/+3
| | | | Just to please scan-build
* gdk: Drop gdk_surface_new_tempMatthias Clasen2020-10-071-23/+0
| | | | It is not used anymore.
* Merge branch 'gdk-cleanups' into 'master'Matthias Clasen2020-09-101-8/+8
|\ | | | | | | | | | | | | Gdk cleanups Closes #2790 See merge request GNOME/gtk!2553
| * gdk: Rename GdkSurfaceState to GdkToplevelStateMatthias Clasen2020-09-101-8/+8
| | | | | | | | | | | | That is what it is. Fixes: #2790
* | gdk: Don't create surfaces of size 0x0Matthias Clasen2020-09-101-1/+1
|/ | | | | | | | Don't pass 0x0 as size when calling gdk_surface_new(). The Wayland backend takes us literally, and we end up with a surface that (temporarily) has these dimensions, confusing other APIs that we pass the size to, such as Vulkan.
* Add a function to request motion eventsMatthias Clasen2020-08-271-1/+65
| | | | | | | We want to ensure that the pointer position is reflected when widget geometry changes, so add a function that tells GDK "please create a motion event at the current position on this surface, if one doesn't happen already".
* Make gdk_surface_get_device_position return a booleanMatthias Clasen2020-08-261-9/+16
| | | | | | | A year ago, we make this function not return the child surface anymore. But the information whether the device is actually over the surface is still useful, and we should not loose it.
* Port tracing to the sysprof collector apiMatthias Clasen2020-08-211-5/+7
| | | | Use the new sysprof collector api to do tracing.
* gdk: Slim down gdkinternals.h moreMatthias Clasen2020-08-141-1/+1
| | | | Move things to the private headers they belong in.
* surface: Add width and height propertiesMatthias Clasen2020-08-081-0/+27
|
* gdk: Move the ::popup-layout-changed signalMatthias Clasen2020-08-081-20/+0
| | | | | Move this signal from GdkSurface to GtkPopup, where it belongs.
* docs: Clean up dangling links in gdk docsMatthias Clasen2020-08-051-5/+5
| | | | Clean up references to no-longer-existing APIs.
* gdk/toplevel: Negotiate surface size via a compute-size signalJonas Ådahl2020-08-051-6/+2
| | | | | | | | | | | | | | | | | | | | | GTK will not up front know how to correctly calculate a size, since it will not be able to reliably predict the constraints that may exist where it will be mapped. Thus, to handle this, calculate the size of the toplevel by having GDK emitting a signal called 'compute-size' that will contain information needed for computing a toplevel window size. This signal may be emitted at any time, e.g. during gdk_toplevel_present(), or spontaneously if constraints change. This also drops the max size from the toplevel layout, while moving the min size from the toplevel layout struct to the struct passed via the signal, This needs changes to a test case where we make sure we process GDK_CONFIGURE etc, which means we also needs to show the window and process all pending events in the test-focus-chain test case.
* gdk: Fix gdk_surface_get_layout_monitorMatthias Clasen2020-08-021-0/+3
| | | | | | | | We are determining the monitor by maximizing the intersection; that only works if our rectangle is not empty. Fixes: #3003
* gdk: Rename gdk_seat_get_physical_devices() to gdk_seat_get_devices()Carlos Garnacho2020-07-301-2/+2
| | | | | We don't want to tell what they are, and the distinction is now less clear. Remove the adjective from the function name.
* gdk: Drop gdk_device_get_device_type()Carlos Garnacho2020-07-301-2/+0
| | | | | There is no longer a hierarchy of devices, or none that is seen on the outside.
* gdk: Avoid gdk_device_get_associated_device()Carlos Garnacho2020-07-301-1/+1
| | | | Query the seat for that.
* Merge branch 'wip/otte/geometry' into 'master'Benjamin Otte2020-07-301-92/+1
|\ | | | | | | | | Some GdkGeometry cleanups See merge request GNOME/gtk!2322