- 19 Feb, 2020 13 commits
-
-
Jonas Ådahl authored
Replace the gdk_surface_move_to_rect() API with a new GdkSurface method called gdk_surface_present_popup() taking a new GdkPopupLayout object describing how they should be laid out on screen. The layout properties provided are the same as the ones used with gdk_surface_move_to_rect(), except they are now set up using GdkPopupLayout. Calling gdk_surface_present_popup() will either show the popup at the position described using the popup layout object and a new unconstrained size, or reposition it accordingly. In some situations, such as when a popup is set to autohide, presenting may immediately fail, in case the grab was not granted by the display server. After a successful present, the result of the layout can be queried using the following methods: * gdk_surface_get_position() - to get the position relative to its parent * gdk_surface_get_width() - to get the current width * gdk_surface_get_height() - to get the current height * gdk_surface_get_rect_anchor() - to get the anchor point on the anchor rectangle the popup was effectively positioned against given constraints defined by the environment and the layout rules provided via GdkPopupLayout. * gdk_surface_get_surface_anchor() - the same as the one above but for the surface anchor. A new signal replaces the old "moved-to-rect" one - "popup-layout-changed". However, it is only intended to be emitted when the layout changes implicitly by the windowing system, for example if the monitor resolution changed, or the parent window moved.
-
Jonas Ådahl authored
The x and y position of GdkSurface is only valid when visible, so reset them to their inital state after hiding.
-
Jonas Ådahl authored
From a handful of hueristics and guess-work, to a single `surface->surface_type == GDK_SURFACE_POPUP`.
-
Jonas Ådahl authored
We can map a non-grabbing popup wherever, it's just the grabbing popup-chain that needs to be ensured not to break any ordering rules. Fix this by managing two lists; one of open popups, and another for grabbing ones.
-
Jonas Ådahl authored
-
Jonas Ådahl authored
-
Jonas Ådahl authored
The returned position should be relative to the parent surface, but GdkSurface::x,y were only managed properly for O-R windows. This makes it correct for regular windows too.
-
Jonas Ådahl authored
Now popups surfaces are always created with the parent set, so we don't need to implement vorious guess work to try to find what the parent might be. Remove that code and just use GdkSurface::parent which is where the parent set during construction ends up at.
-
Jonas Ådahl authored
The corresponding code in gtk/ is long gone, so it's luckly unused these days.
-
Jonas Ådahl authored
Add event queues specifically for surface configuration events (xdg_surface.configure, xdg_toplevel.configure, xdg_popup.configure etc) so that a configuration can be completed without having side effects on other surfaces. This will be used to synchronously configure specific GdkSurfaces, as is needed by the Gtk layout mechanisms.
-
Jonas Ådahl authored
The freezing is conditioned on various state, so lets make the thawing a bit more robust. Without this there was a risk that we'd thaw too many times if there was a frame callback requested while the conditions for the freezing were not met.
-
Jonas Ådahl authored
Position can only be done via gdk_surface_queue_relayout(); the legacy way is no longer possible, so remove the legacy positioning code.
-
Jonas Ådahl authored
-
- 15 Feb, 2020 3 commits
-
-
Benjamin Otte authored
Otherwise the compositor gets all confused when it's trying to make drag happen but we know it's not going to happen. After all, we exchange data behind its back, we just need to keep it informed.
-
Benjamin Otte authored
1. GdkDrop does deserialization, so add the deserialize formats 2. If the drop is local, we can copy straight from the drag, so we can also copy all its formats. This fixes cases where the backend would drop formats it doesn't support.
-
Matthias Clasen authored
The Wayland backend tries to set device tools on these events, and it was just an oversight that they don't carry them.
-
- 14 Feb, 2020 1 commit
-
-
Matthias Clasen authored
GTK is not using this API anymore, and we want to consolidate our surface types to just toplevels and popups.
-
- 13 Feb, 2020 3 commits
-
-
David Hogan authored
For a given OpenGL context, macOS in particular does not support enumeration / detection of OpenGL features that have been promoted to core OpenGL functionality. It is possible other drivers are the same. This change assumes support for GL_ARB_texture_non_power_of_two with OpenGL 2.0+, GL_ARB_texture_rectangle with OpenGL 3.1+ and GL_EXT_framebuffer_blit with OpenGL 3.0+. I failed to find definitive information on whether GL_GREMEDY_frame_terminator has been promoted to OpenGL core, or whether GL_ANGLE_framebuffer_blit or GL_EXT_unpack_subimage have been promoted to core in OpenGL ES. This change results in a significant GtkGLArea performance boost on macOS. Closes #2428
-
Emmanuele Bassi authored
The callback-based content providers need a GDestroyNotify function to free the data passed to them on construction, otherwise they are going to leak.
-
Benjamin Otte authored
The function is fundamentally broken for unbounded surfaces. If a surface is unbounded, we cannot represent this as a cairo_rectangle_int_t, and using the return value doesn't work because it's already used for something else. In GTK3, unbounded surfaces aren't a problem, but GTK4 uses recording surfaces. So better remove that function before we keep using it and using it wrong.
-
- 12 Feb, 2020 10 commits
-
-
Alexander Larsson authored
The marks are averaged based on the name, so this makes more sense. Also rename the map/unmap marks to have the same capitalization as everything else.
-
Alexander Larsson authored
I was getting CI failures like: ../gdk/gdkprofiler.c: In function ‘add_markvf’: ../gdk/gdkprofiler.c:111:3: error: function ‘add_markvf’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]
-
Alexander Larsson authored
This drops the marks for before/after-paint as they are internal things that very rarely use any time, and also flush/resume-events as any events reported here will get separate marks so will be easy to see anyway. Also, we rename the entire frameclock cycle to "frameclock cycle" rather than "paint_idle" which is rather cryptic.
-
Alexander Larsson authored
This is done on the X11 side so we can tell when the map/unmap takes effect and how long it took since the map request.
-
Alexander Larsson authored
These don't take a duration, instead they call g_get_monotonic_time() to and subtract the start time for it. Almost all our calls are like this, and this makes the callsites clearer and avoids inlining the clock call into the call site.
-
Alexander Larsson authored
When we use if (GDK_PROFILER_IS_RUNNING) this means we get an inlined if (FALSE) when the compiler support is not compiled in, which gets rid of all the related code completely. We also expand to G_UNLIKELY(gdk_profiler_is_running ()) in the supported case which might cause somewhat better code generation.
-
Alexander Larsson authored
usec is the scale of the monotonic timer which is where we get almost all the times from. The only actual source of nsec is the opengl GPU time (but who knows what the actual resulution of that is). Changing this to usec allows us to get rid of " * 1000" in a *lot* of places all over the codebase, which are ugly and confusing.
-
Alexander Larsson authored
-
Alexander Larsson authored
-
Alexander Larsson authored
This allows us to avoid hand-rolling g_strdup_printf calls, but also moves the printf into the called function where it doesn't bloat the code of the calling function if the profiler is not running.
-
- 11 Feb, 2020 5 commits
-
-
Alexander Larsson authored
-
Emmanuele Bassi authored
A newly added Vulkan 1.2 error.
-
Emmanuele Bassi authored
-
Emmanuele Bassi authored
We have a bunch of debug-only variables that get set and never used outside of debug code paths, and the compiler is not happy about it.
-
Emmanuele Bassi authored
Otherwise we might return an undefined value, and the compiler will be very cross at us.
-
- 10 Feb, 2020 3 commits
-
-
Alexander Larsson authored
All the code in e.g. init_randr15() divides the physical resolutions with the screen scale, however if we get the screen scale from xsettings rather than e.g. GDK_SCALE the initial setup is using the wrong value. So, whenever the screen scale size is changed we need to trigger a re-read of the randr data
-
Matthias Clasen authored
-
Matthias Clasen authored
-
- 09 Feb, 2020 2 commits
-
-
The string is const, so return it like that.
-
Matthias Clasen authored
-