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.
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.
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
This adds a GDK_DEBUG=default-settings flag which disables reads
from xsettings and Xft resources, and enables this for the testsuite.
This is one less way to get different testresults depending on the
environment. In particular, it was failing the css tests for me
due to getting the wrong font size because i have a different dpi.
We only have implementations of this on X11 and Win32,
so make it available as backend api there.
Update all callers to use either the backend api, or
just monitor 0.
When a device is added, there are two references to it by the device
manager, the initial one and the one used for the id_table. Removing a
device only removed the reference added by the id_table resulting in the
GdkDevice being leaked.
https://gitlab.gnome.org/GNOME/gtk/merge_requests/1358
According to XDND "The XdndLeave message cancels the session.",
issue one when cancelling a drag, so the dest side has an opportunity
to forget about the GdkDrop.
The drag source might be cached and held alive, only disposed after
future drag begin operations. Ensure the drag surface gets hidden
properly or might might stay transparent but mapped till then.
Otherwise the icon "jumps" to the cursor position with its top left when
the animation starts.
This is especially visible if the dragged item is big, like when dragging
mails in Thunderbird.
We use a compilation symbol in our build to allow the inclusion of
specific headers while building GTK, to avoid the need to include only
the global header.
Each namespace has its own compilation symbol because we used to have
different libraries, and strict symbol visibility between libraries;
now that we have a single library, and we can use private symbols across
namespaces while building GTK, we should have a single compilation
symbol, and simplify the build rules.
The "iconified" state is mostly an X11-ism; every other platform calls
this state "minimized" because it may not involve turning a window into
an icon at all.
Previously, the manufacturer property of the GdkMonitor was NULL,
and having at least PNP id at GdkMonitor.manufacturer makes it
possible to distinguish between different monitors programmatically.
Windows/surface's aren't supposed to be explicitly moved by any external
part, so don't provide API for doing so. Usage throughout Gdk is
replaced by the corresponding backend variants.
The generic layer still does the heavy lifting, leaving the backends
more or less just act as thin wrappers, dealing a bit with global
coordinate transformations. The end goal is to remove explicit surface
moving from the generic gdk layer.
To separate how toplevels and popups are configured, a first step is to
introduce a resize-only vfunc for backends to implement. It's meant to
only configure toplevel windows, i.e. popups. Currently it's used for
both types, but introducing the resize-only API is a first step.
When unreffing the stream from a different thread, the close function
will schedule its cleanup asynchornously in the main thread.
We need to make sure the stream object stays alive for as long as
that hasn't happened, so ref() it.
Fixes#2003
To make a frame clock tick as long as any of the associated surfaces
expect to receive ticks, make the surfaces inhibit freezing the clock,
instead of directly tell the frame clock to freeze itself.
This makes it so that as long as any surface using a certain frame clock
is not frozen (e.g. just received a frame event from the display
server), the frame clock will not be frozen.
With this, the frame clock is initiated as frozen, and won't be thawed
until any surface inhibits freeze. It will be frozen again, when every
surface has that previously inhibited freeze uninhibited freeze.
If we set c_marshaller manually, then g_signal_newv() will not setup a
va_marshaller for us. However, if we provide c_marshaller as NULL, it will
setup both the c_marshaller (to g_cclosure_marshal_VOID__VOID) and
va_marshaller (to g_cclosure_marshal_VOID__VOIDv) for us.
The X backend was storing global coordinates
in surface->x/y, and keeping the parent-relative
positions in its own fields. Switch this around
to store the relative position in x/y, as is
expected by the frontend.
Now that popups share the frame clock of their
parent, we have to be much more careful about
freezing the clock, since that may stop updates
for another surface.
This commit makes two changes that make the
X11 handling of the frame clock more similar
to the Wayland backend:
- Use gdk_surface_freeze_updates instead of
gdk_surface_freeze_toplevel_updates to avoid
affecting the frame clock
- Bail out early in before_paint/after_paint
if the surface is frozen, to avoid affecting
the frame clock
Together, these two make the X11 popup surface
type work without freezing updates for the toplevel.
With separate clocks, the phases are not coordinated,
which messes with GTKs size allocation machinery treating
the entire widget tree as a whole, and causes us to
run into assertion where popups get drawn before they
are allocated.
Make them use o-r windows, and move
with their parent.
We do a sort-of ok job on stacking order
here - whenever the parent window gets a
ConfigureNotify, we just restack all popups
directly on top of their parent. This is good
enough to keep popups on top of their parent
while we drag it around, and it gets the popup
to disappear when raising another window on
top of the parent.
Store popup parents separately from transient-for
parents, since these are separate concepts with
different behaviors. And we need the parent in
the frontend, so we can use it in the fallback
move-to-rect implementation.
We don't need the complicated wrapper system anymore,
since client-side windows are gone. This commit moves
all the vfuncs to GtkSurfaceClass, and changes the
backends to just derive their surface implementation
from GdkSurface.