gtk4.git
3 years agoMerge branch 'wip/jimmac/symbolics-gnome-42-sync' into 'main'
Matthias Clasen [Tue, 15 Mar 2022 14:29:27 +0000 (14:29 +0000)]
Merge branch 'wip/jimmac/symbolics-gnome-42-sync' into 'main'

icons: update symbolics

See merge request GNOME/gtk!4571

3 years agoMerge branch 'avoid-objcopy-on-arm' into 'main'
Matthias Clasen [Tue, 15 Mar 2022 13:08:53 +0000 (13:08 +0000)]
Merge branch 'avoid-objcopy-on-arm' into 'main'

build: Avoid objcopy on arm

Closes #4757, #4748, and #4752

See merge request GNOME/gtk!4567

3 years agoicons: update symbolics
Jakub Steiner [Tue, 15 Mar 2022 07:31:26 +0000 (08:31 +0100)]
icons: update symbolics

- match the metaphors/style updates of gnome 42

See https://gitlab.gnome.org/GNOME/gtk/-/issues/4764

3 years agoUpdate Serbian translation
Мирослав Николић [Tue, 15 Mar 2022 06:33:22 +0000 (06:33 +0000)]
Update Serbian translation

(cherry picked from commit b59f9b97f38c40160c79d3c06e301f32eb9cb941)

3 years agoMerge branch 'builder-tool-nodisplay' into 'main'
Matthias Clasen [Mon, 14 Mar 2022 22:15:11 +0000 (22:15 +0000)]
Merge branch 'builder-tool-nodisplay' into 'main'

gtk-builder-tool: Operate without display

See merge request GNOME/gtk!4568

3 years agogtk-builder-tool: Operate without display
Matthias Clasen [Mon, 14 Mar 2022 19:40:12 +0000 (15:40 -0400)]
gtk-builder-tool: Operate without display

The simplify and validate commands can function
without a display connection, only preview absolutely
needs one. Allow this, by using gtk_init_check().

3 years agobuild: Avoid objcopy on arm
Matthias Clasen [Mon, 14 Mar 2022 12:44:09 +0000 (08:44 -0400)]
build: Avoid objcopy on arm

The trickery we do with objcopy and ld to speed up
resource inclusion does not seem to work right on
32bit Arm, so just skip it there.

Fixes: #4757, #4748, #4752
3 years agoUpdate German translation
Christian Kirbach [Sun, 13 Mar 2022 22:08:50 +0000 (22:08 +0000)]
Update German translation

(cherry picked from commit a1f473565213fbf74b1bab4f397a7099a0ce1c30)

3 years agoMerge branch 'wip/lantw/build-Don't-use-ld-and-objcopy-when-cross-compiling' into...
Matthias Clasen [Sun, 13 Mar 2022 14:31:23 +0000 (14:31 +0000)]
Merge branch 'wip/lantw/build-Don't-use-ld-and-objcopy-when-cross-compiling' into 'main'

build: Don't use ld and objcopy when cross-compiling

See merge request GNOME/gtk!4565

3 years agobuild: Don't use ld and objcopy when cross-compiling
Ting-Wei Lan [Sun, 13 Mar 2022 07:14:12 +0000 (15:14 +0800)]
build: Don't use ld and objcopy when cross-compiling

These commands don't work when compiling Windows binaries on Linux.

3 years agoUpdate Hungarian translation
Balázs Úr [Sun, 13 Mar 2022 00:23:04 +0000 (00:23 +0000)]
Update Hungarian translation

3 years agoMerge branch 'wip/chergert/for-main' into 'main'
Matthias Clasen [Sat, 12 Mar 2022 19:07:41 +0000 (19:07 +0000)]
Merge branch 'wip/chergert/for-main' into 'main'

macos: fit'n'finish fixes for main

See merge request GNOME/gtk!4564

3 years agoUpdate Kazakh translation
Baurzhan Muftakhidinov [Sat, 12 Mar 2022 13:23:19 +0000 (13:23 +0000)]
Update Kazakh translation

(cherry picked from commit 6ac723321f23e64e7045f27d7d6ccf5d21ed57ab)

3 years agoUpdate Swedish translation
Anders Jonsson [Sat, 12 Mar 2022 11:39:05 +0000 (11:39 +0000)]
Update Swedish translation

(cherry picked from commit 343b08f3e6b1c4922e9cc4e5a2fa8f9ffe01ff3b)

3 years agomacos: exclude popups from window list
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.

3 years agomacos: pass events to foreign windows
Christian Hergert [Sat, 12 Mar 2022 02:25:47 +0000 (18:25 -0800)]
macos: pass events to foreign windows

3 years agomacos: clear sorted surfaces when showing file chooser
Christian Hergert [Sat, 12 Mar 2022 02:19:44 +0000 (18:19 -0800)]
macos: clear sorted surfaces when showing file chooser

When showing the native file chooser, we need to ensure we clear the
sorted surfaces in the display so that we don't risk delivering events
correctly on the next frame.

3 years agomacos: dont steal key window from NSPanel
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.

3 years agomacos: fix window level for popups
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.

3 years agomacos: fix attachment of popups to parents
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é.

3 years agomacos: fix window activation during shadow click-through
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.

3 years agomacos: select new key window after processing events
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.

3 years agomacos: request layout with server-side decoration
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).

3 years agomacos: fix resize when using server-side decorations
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.

3 years agomacos: set main window in addition to key
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.

3 years agoUpdate Slovak translation
Dušan Kazik [Fri, 11 Mar 2022 07:43:53 +0000 (07:43 +0000)]
Update Slovak translation

(cherry picked from commit c8d1f23ff53ed40e8e033752eab81d3d9d118483)

3 years agoUpdate Hungarian translation
Balázs Úr [Fri, 11 Mar 2022 01:09:19 +0000 (01:09 +0000)]
Update Hungarian translation

3 years agoMerge branch 'better-format-conversions' into 'main'
Matthias Clasen [Thu, 10 Mar 2022 19:26:25 +0000 (19:26 +0000)]
Merge branch 'better-format-conversions' into 'main'

gdk: Clean up the optimised premultiply conversion function

See merge request GNOME/gtk!4550

3 years agoMerge branch 'wlprotocols-dependency-correctness' into 'main'
Matthias Clasen [Thu, 10 Mar 2022 19:15:39 +0000 (19:15 +0000)]
Merge branch 'wlprotocols-dependency-correctness' into 'main'

meson: use proper handling of wayland-protocols dependency

See merge request GNOME/gtk!4561

3 years agomacos: make transient-for key window when hiding surface
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.

3 years agomacos: actually drop unnecessary momentum events
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.

3 years agomacos: queue all pending events
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.

3 years agomeson: use proper handling of wayland-protocols dependency
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.

3 years agoMerge branch 'wip/jimmac/legacy-icons-gtk4' into 'main'
Matthias Clasen [Wed, 9 Mar 2022 23:37:26 +0000 (23:37 +0000)]
Merge branch 'wip/jimmac/legacy-icons-gtk4' into 'main'

icons: add missing legacy fullcolor

See merge request GNOME/gtk!4558

3 years agomacos: drop enter/exit when in manual drag/resize
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.

3 years agomacos: allow dropping NSEvent without propagation
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).

3 years agomacos: do not focus new window when resigning main
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.

3 years agoUpdate Finnish translation
Jiri Grönroos [Wed, 9 Mar 2022 19:03:37 +0000 (19:03 +0000)]
Update Finnish translation

(cherry picked from commit d188c6dbaf4c2d55a53379bc6aafa091913480c9)

3 years agoMerge branch 'fix_gtk_accessible_update_relation_example' into 'main'
Emmanuele Bassi [Wed, 9 Mar 2022 18:22:54 +0000 (18:22 +0000)]
Merge branch 'fix_gtk_accessible_update_relation_example' into 'main'

fix docs for gtk_accessible_update_relation example

See merge request GNOME/gtk!4559

3 years agoFixed Czech translation
Marek Černocký [Wed, 9 Mar 2022 18:06:22 +0000 (19:06 +0100)]
Fixed Czech translation

3 years agofix docs for gtk_accessible_update_relation example
Caolán McNamara [Wed, 9 Mar 2022 12:27:32 +0000 (12:27 +0000)]
fix docs for gtk_accessible_update_relation example

3 years agoicons: add missing legacy fullcolor
Jakub Steiner [Wed, 9 Mar 2022 15:19:16 +0000 (16:19 +0100)]
icons: add missing legacy fullcolor

- relied on in testsuite

See https://gitlab.gnome.org/GNOME/gtk/-/issues/4754

3 years agoUpdate Swedish translation
Anders Jonsson [Wed, 9 Mar 2022 10:49:50 +0000 (10:49 +0000)]
Update Swedish translation

(cherry picked from commit 9053fd8335ff5bd8a94171b791a70347ebc232e9)

3 years agoMerge branch 'fix-focus-issues' into 'main'
Matthias Clasen [Tue, 8 Mar 2022 19:37:45 +0000 (19:37 +0000)]
Merge branch 'fix-focus-issues' into 'main'

Fix some focus issues

See merge request GNOME/gtk!4556

3 years agoUpdate Persian translation
Danial Behzadi [Tue, 8 Mar 2022 15:00:39 +0000 (15:00 +0000)]
Update Persian translation

(cherry picked from commit a9720259f00de1ff9ab99b60627af34c0bbe5c90)

3 years agotext: Stop blinking when we lose focus
Matthias Clasen [Mon, 7 Mar 2022 18:33:45 +0000 (11:33 -0700)]
text: Stop blinking when we lose focus

We were looking at GtkWidget:has-focus from
event controller signal handlers here, but
the widget property is only changed after
the event controllers.

3 years agofocus controller: Update for active window
Matthias Clasen [Mon, 7 Mar 2022 18:32:22 +0000 (11:32 -0700)]
focus controller: Update for active window

When the window gains or looses active status,
update the focus controllers status.

3 years agowindow: Update has-focus property
Matthias Clasen [Mon, 7 Mar 2022 18:35:09 +0000 (11:35 -0700)]
window: Update has-focus property

Update the :has-focus property of the focus
widget when the active status of the window
changes.

We change the property after generating the
GDK_CROSSING_ACTIVE crossing events.

3 years agoUpdated Danish translation
Ask Hjorth Larsen [Tue, 8 Mar 2022 00:28:14 +0000 (01:28 +0100)]
Updated Danish translation

3 years agoUpdated Danish translation of gtk-properties
Ask Hjorth Larsen [Tue, 8 Mar 2022 00:28:11 +0000 (01:28 +0100)]
Updated Danish translation of gtk-properties

3 years agoUpdated Lithuanian translation
Aurimas Černius [Mon, 7 Mar 2022 16:29:37 +0000 (18:29 +0200)]
Updated Lithuanian translation

3 years agoMerge branch 'gdk-tests-naming' into 'main'
Emmanuele Bassi [Mon, 7 Mar 2022 15:34:31 +0000 (15:34 +0000)]
Merge branch 'gdk-tests-naming' into 'main'

Use the correct name for installed gdk tests

See merge request GNOME/gtk!4555

3 years agoUse the correct name for installed gdk tests
Sebastien Bacher [Mon, 7 Mar 2022 15:13:38 +0000 (16:13 +0100)]
Use the correct name for installed gdk tests

3 years agoUpdate Swedish translation
Luna Jernberg [Mon, 7 Mar 2022 08:09:32 +0000 (08:09 +0000)]
Update Swedish translation

(cherry picked from commit 89bba41fd75346aaee5037db7275cfe3c1925fa0)

3 years agoMerge branch 'wip/chergert/for-main' into 'main'
Matthias Clasen [Sun, 6 Mar 2022 01:36:13 +0000 (01:36 +0000)]
Merge branch 'wip/chergert/for-main' into 'main'

macos: fixes for main

See merge request GNOME/gtk!4553

3 years agomacos: fix cursor blink time
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.

3 years agomacos: require input region to become key
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.

3 years agoMerge branch 'fix-doc-typo' into 'main'
Matthias Clasen [Sat, 5 Mar 2022 05:50:10 +0000 (05:50 +0000)]
Merge branch 'fix-doc-typo' into 'main'

Fix a documentation typo

Closes #4747

See merge request GNOME/gtk!4552

3 years agoFix a documentation typo
Matthias Clasen [Sat, 5 Mar 2022 05:18:06 +0000 (22:18 -0700)]
Fix a documentation typo

It is XDG_DATA_HOME.

Fixes: #4747
3 years agoUpdate Catalan translation
Jordi Mas i Hernandez [Fri, 4 Mar 2022 21:40:27 +0000 (21:40 +0000)]
Update Catalan translation

(cherry picked from commit 2be2912e431b6fffdbbccef765c6540537500f9b)

3 years agoUpdate Korean translation
Changwoo Ryu [Fri, 4 Mar 2022 14:22:53 +0000 (14:22 +0000)]
Update Korean translation

3 years agoUpdate Korean translation
Changwoo Ryu [Fri, 4 Mar 2022 14:20:21 +0000 (14:20 +0000)]
Update Korean translation

(cherry picked from commit 2755ad19be279ddced4a220f52a09d40d844dc91)

3 years agoMerge branch 'fixup-shadernode-constructor' into 'main'
Matthias Clasen [Fri, 4 Mar 2022 06:06:35 +0000 (06:06 +0000)]
Merge branch 'fixup-shadernode-constructor' into 'main'

Fix up preconditions of gsk_gl_shader_node_new

Closes #4739

See merge request GNOME/gtk!4551

3 years agoFix up preconditions of gsk_gl_shader_node_new
Matthias Clasen [Fri, 4 Mar 2022 05:39:02 +0000 (22:39 -0700)]
Fix up preconditions of gsk_gl_shader_node_new

These were not quite right, and implied that args
may be NULL, when it really can't.

Fixes: #4739
3 years agoMerge branch 'center-layout-setters' into 'main'
Matthias Clasen [Thu, 3 Mar 2022 19:38:28 +0000 (19:38 +0000)]
Merge branch 'center-layout-setters' into 'main'

gtk: Have GtkCenterLayout hold a reference to its widgets

See merge request GNOME/gtk!4544

3 years agogtk: Have GtkCenterLayout hold a reference to its widgets
Jason Francis [Thu, 3 Mar 2022 00:49:39 +0000 (19:49 -0500)]
gtk: Have GtkCenterLayout hold a reference to its widgets

3 years agoMerge branch 'wip/chergert/KHR_swap_buffers_with_damage' into 'main'
Benjamin Otte [Thu, 3 Mar 2022 15:29:47 +0000 (15:29 +0000)]
Merge branch 'wip/chergert/KHR_swap_buffers_with_damage' into 'main'

gdk: use EGL_KHR_swap_buffers_with_damage

See merge request GNOME/gtk!4548

3 years agogdk: Add a rgb8 → rgba8 conversion macro
Emmanuel Gil Peyrot [Thu, 3 Mar 2022 14:36:57 +0000 (14:36 +0000)]
gdk: Add a rgb8 → rgba8 conversion macro

This one can be used for both premultiplied and non-premultiplied alpha
formats, since alpha is always 255.  It is useful for opaque PNG upload
on both cairo and GL renderers.

3 years agogdk: Make the optimized premultiply function a macro
Emmanuel Gil Peyrot [Thu, 3 Mar 2022 14:34:29 +0000 (14:34 +0000)]
gdk: Make the optimized premultiply function a macro

That way, all permutations are possible.  Previously it was only useful
in the cairo renderer, which required rgba8 → premultiplied bgra8, while
the GL renderer required rgba8 → premultiplied rgba8.  Now both are
available.

3 years agogdk: Remove pixel format conversion ARM intrinsics
Emmanuel Gil Peyrot [Thu, 3 Mar 2022 14:12:06 +0000 (14:12 +0000)]
gdk: Remove pixel format conversion ARM intrinsics

This was only useful when building for AArch32 without -mfpu=neon, on
AArch64 or with -mfpu=neon gcc is smart enough to do the auto-
vectorisation, leading to code almost as good as what I wrote in
1fdf5b7cf8fec2d94389ecad5ec28865f8dcfd99.

3 years agoMerge branch 'bilelmoussaoui/docs' into 'main'
Matthias Clasen [Thu, 3 Mar 2022 14:11:25 +0000 (14:11 +0000)]
Merge branch 'bilelmoussaoui/docs' into 'main'

headerbar: Fix docs

See merge request GNOME/gtk!4545

3 years agoUpdate Korean translation
Changwoo Ryu [Thu, 3 Mar 2022 12:46:34 +0000 (12:46 +0000)]
Update Korean translation

(cherry picked from commit 156f99560d2687c938d1266ad34bc91a9549081e)

3 years agogdk: use EGL_KHR_swap_buffers_with_damage
Christian Hergert [Thu, 3 Mar 2022 06:59:23 +0000 (22:59 -0800)]
gdk: use EGL_KHR_swap_buffers_with_damage

It appears that NVIDIA does not implement EGL_EXT_swap_buffers_with_damage
on their EGL implementation, but does implement the KHR variant of it.
This checks for a suitable implementation and stores a pointer to the
compatible implementation within the GdkGLContextPrivate struct.

3 years agoheaderbar: Fix docs
Bilal Elmoussaoui [Thu, 3 Mar 2022 08:36:33 +0000 (08:36 +0000)]
headerbar: Fix docs

3 years agoMerge branch 'wip/chergert/for-main' into 'main'
Matthias Clasen [Wed, 2 Mar 2022 13:37:06 +0000 (13:37 +0000)]
Merge branch 'wip/chergert/for-main' into 'main'

macos: various fixes

See merge request GNOME/gtk!4543

3 years agoMerge branch 'xdg-activation-no-surface' into 'main'
Carlos Garnacho [Wed, 2 Mar 2022 12:44:52 +0000 (12:44 +0000)]
Merge branch 'xdg-activation-no-surface' into 'main'

wayland: xdg-activation: Don't assume there's a focus surface

See merge request GNOME/gtk!4366

3 years agomacos: clear window stack before requesting motion
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.

3 years agomacos: invalidate surface contents when mapping
Christian Hergert [Wed, 2 Mar 2022 08:48:06 +0000 (00:48 -0800)]
macos: invalidate surface contents when mapping

3 years agomacos: move children when monitor changes
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.

3 years agomacos: make move_resize possibly idempotent
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.

3 years agomacos: handle transient-for from configure
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.

3 years agomacos: use parent frame clock again
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.

3 years agomacos: reduce chances for layout cycles
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.

3 years agomacos: improve initial placement of toplevels with parent
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.

3 years agomacos: leave a note about monitor configuration
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.

3 years agomacos: use GdkMacosBuffer for storing damage region
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.

3 years agomacos: add clamp helper to keep rectangle in workarea
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).

3 years agomacos: style cleanup
Christian Hergert [Wed, 2 Mar 2022 08:33:13 +0000 (00:33 -0800)]
macos: style cleanup

3 years agomacos: add re-entrancy check when monitors change
Christian Hergert [Wed, 2 Mar 2022 08:32:50 +0000 (00:32 -0800)]
macos: add re-entrancy check when monitors change

3 years agomacos: check for best_monitor before using
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.

3 years agoUpdate Croatian translation
Goran Vidović [Tue, 1 Mar 2022 13:04:47 +0000 (13:04 +0000)]
Update Croatian translation

(cherry picked from commit 4eee322654907f2f16c2b36bbd7aa47e36a0462f)

3 years agoUpdate Croatian translation
Goran Vidović [Tue, 1 Mar 2022 12:53:52 +0000 (12:53 +0000)]
Update Croatian translation

(cherry picked from commit 67ae05d85598f5ba7dcdd8da3420c41d7347b158)

3 years agoMerge branch 'wip/carlosg/focus-request-over-xdg-activation' into 'main'
Carlos Garnacho [Tue, 1 Mar 2022 11:21:12 +0000 (11:21 +0000)]
Merge branch 'wip/carlosg/focus-request-over-xdg-activation' into 'main'

wayland: Use xdg-activation for non-startup initiated focus requests

See merge request GNOME/gtk!4535

3 years agoUpdated Czech translation
Marek Černocký [Tue, 1 Mar 2022 11:08:18 +0000 (12:08 +0100)]
Updated Czech translation

3 years agowayland: Use xdg-activation for non-startup initiated focus requests
Carlos Garnacho [Mon, 28 Feb 2022 17:31:40 +0000 (18:31 +0100)]
wayland: Use xdg-activation for non-startup initiated focus requests

Currently, we have all the plumbing in place so that GTK consumes the
startup notification ID when focusing a window through the xdg-activation
protocol.

This however misses the case that a window might be requested to be
focused with no startup ID (i.e. via interaction with the application,
not through GApplication or other application launching logic).

In this case, we let the application create a token that will be
consumed by itself. The serial used is that from the last
interaction, so the compositor will still be able to do focus prevention
logic if it applies.

Since we already do have a last serial at hand, prefer xdg-activation
all the way over the now stale gtk-shell focusing support. The timestamp
argument becomes unused, but that is a weak argument to prefer the
private protocol over the standard one. The gtk-shell protocol support
is so far left for interaction with older Mutter.

3 years agoMerge branch 'wip/chergert/for-main' into 'main'
Matthias Clasen [Mon, 28 Feb 2022 22:13:03 +0000 (22:13 +0000)]
Merge branch 'wip/chergert/for-main' into 'main'

macos: various fixes and multi-monitor frame clocks

Closes #4736, #4735, #4732, #4733, and #4734

See merge request GNOME/gtk!4533

3 years agoMerge branch 'wip/carlosg/scrolledwindow-warning' into 'main'
Matthias Clasen [Mon, 28 Feb 2022 21:50:19 +0000 (21:50 +0000)]
Merge branch 'wip/carlosg/scrolledwindow-warning' into 'main'

gtkscrolledwindow: Do not try to doubly trigger deceleration

Closes #4730

See merge request GNOME/gtk!4536

3 years agomacos: avoid size/origin changes when possible
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.

3 years agomacos: start application in foreground
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

3 years agomacos: add GDK_NOTE when surface changes monitor
Christian Hergert [Mon, 28 Feb 2022 20:13:29 +0000 (12:13 -0800)]
macos: add GDK_NOTE when surface changes monitor