Emmanuele Bassi [Thu, 14 Apr 2022 21:44:17 +0000 (22:44 +0100)]
Mark nullable arguments in GtkPaned
The set_start_child() and set_end_child() methods take NULL for the
child argument, as a way to remove the child from the paned widget.
Emmanuele Bassi [Thu, 14 Apr 2022 21:43:40 +0000 (22:43 +0100)]
docs: Fix the GtkPaned style
Use proper links to properties and methods, and drop gtk-doc'isms.
Julian Sparber [Thu, 14 Apr 2022 10:14:17 +0000 (12:14 +0200)]
label: Move focus out of widget after last link
This allows the user to navigate via tab the links in a label and exits
the widget after the last link, when moving forward, and first link,
when moving backward.
This also ensures that ellipsised links arn't focused.
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4681
Julian Sparber [Wed, 13 Apr 2022 16:56:29 +0000 (18:56 +0200)]
label: Maintain value for `has-tooltip` for labels with links
The `has-tooltip` property gets set to `false` for label with links if no
link is selected. This makes sure to only change the property to `true`
but never to `false`.
Ivan Molodetskikh [Mon, 11 Apr 2022 07:31:52 +0000 (10:31 +0300)]
scrollable: Clarify when to set adjustment props
Instead of populating the properties right away (when the widget might
not have been allocated yet, and hence cannot know the right values),
the widget should queue an allocation, where it will populate the
values.
Matthias Clasen [Fri, 8 Apr 2022 15:18:15 +0000 (11:18 -0400)]
gsk/gl: Typo fix
Matthias Clasen [Sun, 5 Dec 2021 03:16:01 +0000 (22:16 -0500)]
gtk-demo: Small fixup to the cursors demo
Carlos Garnacho [Wed, 6 Apr 2022 11:08:00 +0000 (13:08 +0200)]
imwayland: Do not defer commit() after set_surrounding_text()
For reasons that only apply to the old serial handling, asking for
the surrounding after IM changes resulted in lazy handling of
commit() afterwards.
With the recent interpretation of serials, this problem became more
apparent, since it is in fact very likely that the last interaction
step after an IM change is notifying of the changed surrounding
text after the IM change was applied.
Make handling of surrounding text similar to caret position changes,
always commit() after the state change, but skip through non-changes.
This makes the compositor state fully up-to-date after an IM change.
Carlos Garnacho [Wed, 6 Apr 2022 09:01:01 +0000 (11:01 +0200)]
imwayland: Connect OSK activating gesture to parent widget on editables
The gesture as connected currently on the child GtkText is easily overridden
by the parent editables (and gently done so in the attempt to consume all
clicks).
Connect this gesture to the parent editable widget in these cases, so the
gesture can cohabit with the click-consuming one. It's not part of the same
group, but it won't be abruptly cancelled.
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4795
Sebastian Keller [Mon, 4 Apr 2022 20:55:16 +0000 (22:55 +0200)]
testsuite: Add unaligned-offscreen test
Tests whether text rendered to an offscreen node unaligned with the
pixel grid introduces blurriness.
Sebastian Keller [Thu, 31 Mar 2022 14:44:34 +0000 (16:44 +0200)]
gsk/gl: Always align offscreen rendering with the pixel grid
This fixes two issues with the offscreen rendering code for nodes with
bounds not aligned with the pixel grid:
1.) When drawing to an offscreen buffer the size of the offscreen buffer
was rounded up, but then later when used as texture the vertices
correspond to the original bounds with the unrounded size. This could
then result in the offscreen texture being drawn onscreen at a slightly
smaller size, which then lead to it being visually shifted and blurry.
This is fixed by adjusting the u/v coordinates to ignore the padding
region in the offscreen texture that got added by the size increase from
rounding.
2.) The viewport used when rendering to the offscreen buffer was not
aligned with the pixel grid for nodes at coordinates not aligned with
the pixel grid. Then because the content of the offscreen buffer is not
aligned with the pixel grid and later when used as textures sampling
from it will result in interpolated values for an onscreen pixel. This
could also result in shifting and blurriness, especially for nested
offscreen rendering at different offsets.
This is fixed by adding similar padding at the beginning of the
texture and also adjusting the u/v coordinates to ignore this region.
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3833
Maximiliano Sandoval R [Mon, 4 Apr 2022 12:11:16 +0000 (14:11 +0200)]
application: Add link and inline code blocks
Maximiliano Sandoval R [Mon, 4 Apr 2022 12:10:56 +0000 (14:10 +0200)]
filter: Add link to FilterListmodel
Maximiliano Sandoval R [Mon, 4 Apr 2022 12:10:18 +0000 (14:10 +0200)]
texttag: Correct typo
Does not generate a gir docstring without it.
Matthias Clasen [Sun, 3 Apr 2022 19:53:52 +0000 (15:53 -0400)]
inspector: Avoid another crash
We need to handle all event types here.
This was tripping over GDK_TOUCHPAD_HOLD events.
Matthias Clasen [Sun, 3 Apr 2022 19:53:34 +0000 (15:53 -0400)]
inspector: Avoid a crash
Attribute lists can be NULL, it turns out.
Matthias Clasen [Sun, 3 Apr 2022 12:04:35 +0000 (08:04 -0400)]
css: Plug a memory leak
We were leaking the terms of calc values. Oops.
illiliti [Sun, 3 Apr 2022 11:55:33 +0000 (14:55 +0300)]
meson: Use proper type for bools
Fix invalid usage of bools which violates official meson specification and thus
breaks muon, an implementation of meson written in C.
Matthias Clasen [Sat, 2 Apr 2022 19:22:12 +0000 (15:22 -0400)]
imcontextsimple: Plug a memory leak
Maximiliano Sandoval R [Fri, 1 Apr 2022 11:04:14 +0000 (13:04 +0200)]
docs: Fix links in selection models
Xavier Claessens [Thu, 31 Mar 2022 15:41:34 +0000 (11:41 -0400)]
Remove #ifdef ENABLE_NLS
libintl API is guaranteed to always be available, glib will fallback to
proxy-libintl in case gettext is not found.
Dr. David Alan Gilbert [Thu, 31 Mar 2022 14:56:09 +0000 (15:56 +0100)]
x11: Check return of gdk_x11_get_xatom_name_for_display
When given an invalid atom, gdk_x11_get_xatom_name_for_display can
return NULL and trigger a seg in gdk_x11_clipboard_formats_from_atoms.
Check for NULL.
Why I'm seeing a bad atom there is probably a separate question.
https://bugzilla.redhat.com/show_bug.cgi?id=
2037786
Chun-wei Fan [Wed, 30 Mar 2022 02:23:49 +0000 (10:23 +0800)]
inspector/general.c: Check whether GL context supports WGL
We may well be using an EGL context that does not support Desktop (W)GL on
Windows, such as in the case of using libANGLE. So, check whether WGL is
supported for this running instance before trying to query WGL extensions.
This will get rid of warning messages from libepoxy.
Alexander Mikhaylenko [Sun, 27 Mar 2022 21:05:23 +0000 (01:05 +0400)]
eventcontrollerscroll: Always propagate hold events
Otherwise a stray scroll controller may prevent others from getting hold
events, even if it always propagates scroll events and does absolutely
nothing.
Christoph Reiter [Sun, 27 Mar 2022 17:08:36 +0000 (19:08 +0200)]
CI: clean up MSYS2 build dependencies
We only need a C compiler and not the whole toolchain,
and gst-plugins-bad was split into libraries and plugins.
pkg-config -> pkgconf.
This should speed the CI setup up a bit.
Matthias Clasen [Fri, 25 Mar 2022 12:35:16 +0000 (08:35 -0400)]
inspector: Allow viewing PangoAttrList properties
We have pango_attr_list_to/from_string, so this is
easy. The editing UI isn't ideal, but it solves my
immediate need to see attributes.
Christian Hergert [Thu, 24 Mar 2022 03:20:02 +0000 (20:20 -0700)]
gdk/gl: handle GL_RGBA/GL_UNSIGNED_NORMALIZED
WebKit's GTK 4 port can give us textures with an internal format of
GL_RGBA with GL_UNSIGNED_NORMALIZED and a bit-depth of 8. This fixes
warnings for every GdkGLTexture created/delivered to the GskGLRenderer.
The format is essentially the same as GL_RGBA8 since it is normalized
between 0.0..1.0 for 8-bit components.
Fixes #4783
Sebastian Keller [Tue, 22 Mar 2022 07:11:18 +0000 (08:11 +0100)]
surface: Use correct display when destroying a surface for depth switch
When surface depth switches from non-high-depth to high-depth (or vice
versa) the current surface has to be destroyed before a new one can be
created for this window. eglDestroySurface however was getting passed a
GdkDisplay, rather than the EGLDisplay it expects. As a result the old
surface did not get destroyed and the new surface could not be created
causing rendering to freeze.
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4773
Christian Hergert [Tue, 22 Mar 2022 01:54:09 +0000 (18:54 -0700)]
Default: avoid use of opacity for overlay scrollbars
If using the opacity CSS property the renderer cannot optimize these
handles without the use of offscreens due to the use of both a border
and rgb render node.
Instead, we can apply the alpha to the color values and get the same
effect in a way that the GL renderer can optimize without the use of
offscreen textures for a sizeable reduction in runtime overhead.
Yosef Or Boczko [Sat, 19 Mar 2022 22:43:57 +0000 (00:43 +0200)]
popover-menu: Fix buttons' position in RTL
The radio/check/previous buttons shows in
the wrong place in RTL. Fix it.
#4641
Signed-off-by: Yosef Or Boczko <yoseforb@gmail.com>
aneejit1 [Sat, 19 Mar 2022 10:41:32 +0000 (10:41 +0000)]
Check for 'rst2man' misses installed 'rst2man.py' (#4728)
By default, 'docutils' installs 'rst2man' as 'rst2man.py'. Amend the
check for 'rst2man' to look for 'rst2man.py' as well if 'rst2man' is
not found.
Matthias Clasen [Wed, 20 Apr 2022 15:35:21 +0000 (15:35 +0000)]
Merge branch 'cherry-pick-
b67da389' into 'gtk-4-6'
Backport: gtkimmulticontext: Handle switches between displays
See merge request GNOME/gtk!4660
Carlos Garnacho [Thu, 31 Mar 2022 14:29:34 +0000 (16:29 +0200)]
gtkimmulticontext: Handle switches between displays
Currently the GtkIMMultiContext may stick to a delegate GtkIMContext
that no longer applies after the multicontext is dissociated from
any widget.
Handle set_client_widget() so that it can handle changes between
widgets from 2 different display, but also so the delegate is made
NULL whenever the context has a NULL widget.
Doing so, any new client widget results in a new delegate IM context
lookup from the right GdkDisplay and GtkSettings, which avoids any
mix up.
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4805
(cherry picked from commit
b67da38916b710ba6eedd65ffb569a29e47ddb4d)
Matthias Clasen [Wed, 20 Apr 2022 01:34:51 +0000 (01:34 +0000)]
Merge branch 'filechooser-fixes-4-6' into 'gtk-4-6'
filechooser: cherry-pick fixes from main for 4.6
See merge request GNOME/gtk!4654
Matthias Clasen [Wed, 20 Apr 2022 01:30:51 +0000 (01:30 +0000)]
Merge branch 'ebassi/issue-4825-backport' into 'gtk-4-6'
a11y: Defer object registration after root registration
See merge request GNOME/gtk!4658
Emmanuele Bassi [Tue, 19 Apr 2022 15:12:08 +0000 (16:12 +0100)]
a11y: Defer object registration after root registration
The root accessible object is registered asynchronously, as it needs to
call a method on the AT-SPI registry daemon. This means we need to defer
registering the GtkAtSpiContext on the accessibility bus and in the
cache until after the registration is complete.
Fixes: #4825
Matthias Clasen [Sun, 17 Apr 2022 02:00:22 +0000 (22:00 -0400)]
filechooser: Small fix for save mode
When changing folders, we were making the select
button insensitive when there's no files around.
That doesn't make sense in save mode when we don't
want to select a file but create one.
Fixes: #4851
Matthias Clasen [Sun, 17 Apr 2022 03:29:04 +0000 (23:29 -0400)]
filechooser: Prevent random completion popups
It is very irritating when the entry completion popup
appears not in response to user input in the entry.
In particular, when that happens right as the dialog
is shown.
To prevent that, temporarily disable completion
when setting the entry text programmatically.
Luca Bacci [Fri, 8 Apr 2022 13:58:29 +0000 (13:58 +0000)]
Merge branch 'gdk-win32-fix-mouse-move-crossing-events-gtk-4-6' into 'gtk-4-6'
GdkWin32: Mouse events fixes
See merge request GNOME/gtk!4627
Luca Bacci [Wed, 6 Apr 2022 18:01:51 +0000 (20:01 +0200)]
GdkWin32: Generate crossing event after button release
Fixes #4813
Luca Bacci [Mon, 4 Apr 2022 13:29:52 +0000 (15:29 +0200)]
GdkWin32: Correct generation of crossing events when holding an implicit grab
Fixes #4722
Luca Bacci [Wed, 6 Apr 2022 17:45:50 +0000 (19:45 +0200)]
GdkWin32: Report serial for events
Luca Bacci [Fri, 8 Apr 2022 08:30:48 +0000 (08:30 +0000)]
Merge branch 'backport-4406-4.6' into 'gtk-4-6'
gdkclipboard-win32.c: Fix call to gdk_clipboard_claim_remote() (backport MR !4604 to gtk-4-6)
See merge request GNOME/gtk!4608
Christian Hergert [Mon, 4 Apr 2022 18:53:19 +0000 (18:53 +0000)]
Merge branch 'sumibi-yakitori/fix-minimize-window-macos' into 'main'
macos: Fix problem that window cannot be minimized by user operation
Closes #4811
See merge request GNOME/gtk!4613
(cherry picked from commit
d75147db0acd7723732790155fd3a63688193c63)
d3cf7088 macos: Skip running `showAndMakeKey` when a window is minimized by user action
Christian Hergert [Sun, 3 Apr 2022 22:14:52 +0000 (22:14 +0000)]
Merge branch 'sumibi-yakitori/fix-maximize-window-macos' into 'main'
macos: prohibit fullscreen transition if in transtion
This prevents performing additional fullscreen transitions while
a transition is already in progress.
Closes #4808
See merge request GNOME/gtk!4612
(cherry picked from commit
15b7a4572b3a06aefed75bb7989c711763af65f7)
69a0a5cf macos: Prohibit changing the full-screen state of a window during a full-screen transition
229e4b58 macos: Corrected code style
Andika Triwidada [Fri, 1 Apr 2022 04:10:57 +0000 (04:10 +0000)]
Update Indonesian translation
Andika Triwidada [Fri, 1 Apr 2022 04:04:49 +0000 (04:04 +0000)]
Update Indonesian translation
Chun-wei Fan [Thu, 31 Mar 2022 02:36:45 +0000 (10:36 +0800)]
gdkclipboard-win32.c: Fix call to gdk_clipboard_claim_remote()
The call to gdk_win32_clipboard_request_contentformats() can return NULL even
without an error condition being hit (such as when the system clipboard is
empty), so check whether the returned GdkContentFormat pointer is not NULL
before calling gdk_clipboard_claim_remote(), which expects it to be not NULL,
otherwise we face a warning from that funtion and the subsequent
g_object_unref().
This at least partially fixes issue #4796.
Rūdolfs Mazurs [Sun, 27 Mar 2022 20:19:10 +0000 (20:19 +0000)]
Update Latvian translation
Rūdolfs Mazurs [Sun, 27 Mar 2022 19:53:51 +0000 (19:53 +0000)]
Update Latvian translation
Emmanuele Bassi [Sun, 27 Mar 2022 18:24:38 +0000 (18:24 +0000)]
Merge branch 'cherry-pick-
351ffef7' into 'gtk-4-6'
overlaylayout: Set position style class on child
See merge request GNOME/gtk!4598
António Fernandes [Sun, 27 Mar 2022 14:59:10 +0000 (14:59 +0000)]
overlaylayout: Set position style class on child
As documented:
> Overlay children whose alignments cause them to be positioned
> at an edge get the style classes “.left”, “.right”, “.top”,
> and/or “.bottom” according to their position.
Likely accidental regression in
b7ee2cbc289b4ab8a950cd77bdcd69a6f13932a7
Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2099
(cherry picked from commit
351ffef70481c109f151b6fef84060c4e4847b43)
Bruce Cowan [Thu, 24 Mar 2022 13:19:20 +0000 (13:19 +0000)]
Update British English translation
Marek Černocký [Mon, 21 Mar 2022 11:16:07 +0000 (12:16 +0100)]
Updated Czech translation
Philipp Kiemle [Sat, 19 Mar 2022 12:32:20 +0000 (12:32 +0000)]
Update German translation
Matthias Clasen [Sat, 19 Mar 2022 00:29:42 +0000 (20:29 -0400)]
4.6.2
Matthias Clasen [Sat, 19 Mar 2022 00:37:58 +0000 (00:37 +0000)]
Merge branch 'alatiera/stable-wraps-4-6' into 'gtk-4-6'
meson: use proper handling of wayland-protocols dependency
See merge request GNOME/gtk!4580
James Westman [Thu, 17 Mar 2022 15:49:39 +0000 (10:49 -0500)]
filefilter: Fix <suffixes> in buildable
A bug in GtkFileFilter's GtkBuildable implementation caused the
<suffixes> tag not to be recognized.
Jordan Petridis [Wed, 16 Mar 2022 07:53:16 +0000 (09:53 +0200)]
meson: switch some .wrap files to stable branches
To avoid random failures if one of the projects starts
depending on new things or has incompatible changes.
Eli Schwartz [Thu, 10 Mar 2022 05:08:36 +0000 (00:08 -0500)]
meson: use proper handling of wayland-protocols dependency
Ensure that resolution of the subproject occurs via the dependency
interface, not the "poke at subprojects manually" interface, and make
that actually work via --wrap-mode=forcefallback.
There's no need to mark it as not-required and then manually invoke
subproject(), since fallback should work correctly and it is always
needed.
However, if fallback was performed (or forced) it would error out since
get_variable() was instructed to only use pkg-config while the relevant
variable was exported by the subproject as an internal fallback
dependency.
Milo Casagrande [Thu, 17 Mar 2022 08:35:42 +0000 (08:35 +0000)]
Update Italian translation
Milo Casagrande [Thu, 17 Mar 2022 08:34:04 +0000 (08:34 +0000)]
Update Italian translation
Мирослав Николић [Thu, 17 Mar 2022 06:04:15 +0000 (06:04 +0000)]
Update Serbian translation
Matthias Clasen [Thu, 17 Mar 2022 01:50:18 +0000 (01:50 +0000)]
Merge branch 'wip/carlosg/backports-4-6' into 'gtk-4-6'
Backport fixes to 4.6
See merge request GNOME/gtk!4577
Matthias Clasen [Wed, 16 Mar 2022 20:03:38 +0000 (20:03 +0000)]
Merge branch 'wip/chergert/for-4-6' into 'gtk-4-6'
backport macOS fixes to gtk-4-6
See merge request GNOME/gtk!4578
Christian Hergert [Sat, 12 Mar 2022 06:36:26 +0000 (22:36 -0800)]
macos: exclude popups from window list
This probably only matters if you do window list integration for the global
menu on macOS.
Christian Hergert [Sat, 12 Mar 2022 02:25:47 +0000 (18:25 -0800)]
macos: pass events to foreign windows
Christian Hergert [Sat, 12 Mar 2022 02:07:34 +0000 (18:07 -0800)]
macos: dont steal key window from NSPanel
Or we risk making it really difficult to use native file choosers.
Christian Hergert [Sat, 12 Mar 2022 02:01:05 +0000 (18:01 -0800)]
macos: fix window level for popups
This comment isn't really accurate anymore it seems, so we can start
setting the proper stacking order for popups now.
Christian Hergert [Sat, 12 Mar 2022 01:53:42 +0000 (17:53 -0800)]
macos: fix attachment of popups to parents
We had code to do it and it never actually got used correctly. This ensures
that the popup services are attached to the parents so that they get proper
stacking orders when displayed. Additionally, it fixes popups from being
shown as their own windows in Exposé.
Christian Hergert [Fri, 11 Mar 2022 01:26:56 +0000 (17:26 -0800)]
macos: fix window activation during shadow click-through
If we are clicking through the shadow of a window, we need to take special
care to not raise the old window on mouseUp. This is normally done by the
display server for us, so we need to use the proper API that is public to
handle this (rather than CGSSetWindowTags()). Doing so requires us to
dispatch the event to the NSView and then cancel the activcation from
the mouseDown: event there.
Christian Hergert [Fri, 11 Mar 2022 08:50:10 +0000 (00:50 -0800)]
macos: select new key window after processing events
If we closed a key window in response to events, we need to denote another
window as the new key window. This is easiest to do from an idle so that
we don't clobber notification pairs of "did resign"/"did become" key
window.
We have a sorted set of surfaces by display server stacking, so we can
take the first one we come across that is already mapped and re-show it
to become key/main.
Christian Hergert [Fri, 11 Mar 2022 07:16:38 +0000 (23:16 -0800)]
macos: request layout with server-side decoration
If we have server-side decorations we might need to request a layout in
response to the resize notification. We don't need to do this in other
cases because we already handle that in the process of doing the resize
(and that code is that way because of delayed delivery of NSNotification).
Christian Hergert [Fri, 11 Mar 2022 02:58:10 +0000 (18:58 -0800)]
macos: fix resize when using server-side decorations
If we are using NSWindow titled windows, we don't end up waking up the
frame clock when the window is resized on the display server. This ensures
that we do that after getting a notification of resize.
Christian Hergert [Fri, 11 Mar 2022 07:49:48 +0000 (23:49 -0800)]
macos: set main window in addition to key
If we are showing the window, we might also want to make it the main
window for the application when shown.
Christian Hergert [Thu, 10 Mar 2022 16:04:14 +0000 (08:04 -0800)]
macos: make transient-for key window when hiding surface
This only handled the popover case before and not the transient-for case.
Christian Hergert [Thu, 10 Mar 2022 11:21:12 +0000 (03:21 -0800)]
macos: actually drop unnecessary momentum events
These would get passed along to the NSApplication which we don't really
need to have happen. Denote it as such.
Christian Hergert [Thu, 10 Mar 2022 11:20:07 +0000 (03:20 -0800)]
macos: queue all pending events
Rather than process these a single event at a time, queue all of the
outstanding events from the NSEvent queue.
Christian Hergert [Wed, 9 Mar 2022 21:20:53 +0000 (13:20 -0800)]
macos: drop enter/exit when in manual drag/resize
If we are in a manual resize/drag then we don't want to generate crossing
events as they can just confuse things.
Christian Hergert [Wed, 9 Mar 2022 21:19:22 +0000 (13:19 -0800)]
macos: allow dropping NSEvent without propagation
There are cases we might want to consume a NSEvent without creating a
GdkEvent or passing it along to the NSApplication for processing. This
creates a new value we can use and check against to propagate that without
having to do out parameters at the slightly odd invalid pointer value for
a GdkEvent (similar to how MMAP_FAILED is done).
Christian Hergert [Mon, 7 Mar 2022 22:31:23 +0000 (14:31 -0800)]
macos: do not focus new window when resigning main
This can get in the way of how we track changes while events are actively
processing. Instead, we may want to delay this until the next main loop
idle and then check to see if we have a main window as the NSNotification
may have come in right after this.
Christian Hergert [Thu, 3 Mar 2022 04:32:19 +0000 (20:32 -0800)]
macos: fix cursor blink time
The value from settings is for the duration of the blink period, not the
timeout. This fixes the blink lasting longer than 10 seconds.
Christian Hergert [Thu, 3 Mar 2022 03:59:15 +0000 (19:59 -0800)]
macos: require input region to become key
Some things cannot become key windows (like tooltips). We can use the
input_region existence to determine if we should allow it as a key window.
Christian Hergert [Wed, 2 Mar 2022 09:04:53 +0000 (01:04 -0800)]
macos: clear window stack before requesting motion
We want to ensure that we recalculate the sort order of windows before
processing the motion. Generally this would be done in response from the
display server in GdkMacosWindow, but I've seen it possible to race there.
Christian Hergert [Wed, 2 Mar 2022 08:48:06 +0000 (00:48 -0800)]
macos: invalidate surface contents when mapping
Christian Hergert [Wed, 2 Mar 2022 08:47:27 +0000 (00:47 -0800)]
macos: move children when monitor changes
We can rely on other code to move monitors, but specifically with children
we want to try harder to move them as a group and keep positioning in tact.
Christian Hergert [Wed, 2 Mar 2022 08:45:44 +0000 (00:45 -0800)]
macos: make move_resize possibly idempotent
We need to handle the case where we might be racing against an incoming
configure event due to how notifications are queued from the display
server. Rather than calling configure (and possibly causing other things
to move around) this just queries the display server directly for the
coordinates that we care about.
Additionally, we can display:NO as we are in control of all the display
process now using CALayer.
Christian Hergert [Wed, 2 Mar 2022 08:43:33 +0000 (00:43 -0800)]
macos: handle transient-for from configure
We failed to handle the toplevel with transient-for case here which could
cause our X/Y calculations to be off in other areas such as best monitor
detection.
Christian Hergert [Wed, 2 Mar 2022 08:42:09 +0000 (00:42 -0800)]
macos: use parent frame clock again
We do actually need the parent frame clock here because it is the way we
ensure that we get layout called for our popup surfaces at the same time
as the parent surface.
Christian Hergert [Wed, 2 Mar 2022 08:40:21 +0000 (00:40 -0800)]
macos: reduce chances for layout cycles
We need to be more careful about when we request a layout because it can
cause us to get into a layout cycle at maximum frame rate.
Christian Hergert [Wed, 2 Mar 2022 08:38:39 +0000 (00:38 -0800)]
macos: improve initial placement of toplevels with parent
This doesn't appear to happen much, but if it does it is nice to setup
the window placement initially. Generally, transient-for is set after
the creation of the toplevel rather than here.
Christian Hergert [Wed, 2 Mar 2022 08:37:07 +0000 (00:37 -0800)]
macos: leave a note about monitor configuration
It can be helpful to see what the range of monitor values is when emulating
the GDK coordinate system.
Christian Hergert [Wed, 2 Mar 2022 08:36:17 +0000 (00:36 -0800)]
macos: use GdkMacosBuffer for storing damage region
The GdkMacosBuffer object already has storage for tracking the damage
region as it is used in GdkMacosCairoContext to manually copy regions from
the front buffer to the back buffer. This makes the GdkMacosGLContext also
use that field so that we can easily drop old damage regions when the
buffer is lost. This happens during resizes, monitor changes, etc.
Christian Hergert [Wed, 2 Mar 2022 08:34:27 +0000 (00:34 -0800)]
macos: add clamp helper to keep rectangle in workarea
This helper is useful to ensure we are consistent with how we keep a
window clamped to the workarea of a monitor when placing windows on
screen. (This does not affect snap-to-edges).
Christian Hergert [Wed, 2 Mar 2022 08:33:13 +0000 (00:33 -0800)]
macos: style cleanup
Christian Hergert [Wed, 2 Mar 2022 08:32:50 +0000 (00:32 -0800)]
macos: add re-entrancy check when monitors change
Christian Hergert [Mon, 28 Feb 2022 21:57:29 +0000 (13:57 -0800)]
macos: check for best_monitor before using
Make sure we have a monitor to enqueue/dequeue from before using it. That
also allows us to use this from destroy and what-not.
Christian Hergert [Mon, 28 Feb 2022 21:09:57 +0000 (13:09 -0800)]
macos: avoid size/origin changes when possible
If _gdk_macos_surface_move_resize() was called with various -1 parameters
we really want to avoid changing anything even if we think we know what
the value might be. Otherwise, we risk messing up in-flight operations that
we have not yet been notified of yet.
This improves the chances we place windows in an appropriate location as
they don't et screwed up before window-manager placement.
Christian Hergert [Mon, 28 Feb 2022 20:20:24 +0000 (12:20 -0800)]
macos: start application in foreground
We need to bring the application to the foreground in multiple ways, and
this call to [NSApp activateIgnoringOtherApps:YES] ensures that we become
foreground before the first window is opened. Otherwise we end up starting
applications in the background.
Fixes #4736
Christian Hergert [Mon, 28 Feb 2022 20:13:29 +0000 (12:13 -0800)]
macos: add GDK_NOTE when surface changes monitor