gtk4.git
3 years agoUpdate Russian translation
Aleksandr Melman [Wed, 2 Mar 2022 19:29:31 +0000 (19:29 +0000)]
Update Russian translation

3 years agoUpdate Turkish translation
Emin Tufan Çetin [Wed, 2 Mar 2022 13:05:48 +0000 (13:05 +0000)]
Update Turkish translation

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

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

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

3 years agoUpdate Brazilian Portuguese translation
Rafael Fontenelle [Mon, 28 Feb 2022 14:46:55 +0000 (14:46 +0000)]
Update Brazilian Portuguese translation

3 years agoUpdate Galician translation
Fran Dieguez [Sun, 27 Feb 2022 22:45:33 +0000 (22:45 +0000)]
Update Galician translation

3 years agoUpdate Basque translation
Asier Sarasua Garmendia [Sun, 27 Feb 2022 08:05:18 +0000 (08:05 +0000)]
Update Basque translation

3 years agoUpdate Portuguese translation
Hugo Carvalho [Sat, 26 Feb 2022 18:09:30 +0000 (18:09 +0000)]
Update Portuguese translation

3 years agoUpdate Ukrainian translation
Yuri Chornoivan [Sat, 26 Feb 2022 13:05:23 +0000 (13:05 +0000)]
Update Ukrainian translation

3 years agoUpdate Polish translation
Piotr Drąg [Sat, 26 Feb 2022 12:29:19 +0000 (13:29 +0100)]
Update Polish translation

3 years agomacos: fix positioning of popover tails
Christian Hergert [Fri, 25 Feb 2022 00:29:53 +0000 (16:29 -0800)]
macos: fix positioning of popover tails

This broke with the previous fixes for initial window positioning. We need
the initial positioning so that tails will be displayed correctly when the
popover surface is displayed.

3 years agoMerge branch 'wip/chergert/macos-window-manager' into 'main'
Matthias Clasen [Wed, 23 Feb 2022 03:53:33 +0000 (03:53 +0000)]
Merge branch 'wip/chergert/macos-window-manager' into 'main'

macos: improve placement of windows

See merge request GNOME/gtk!4510

3 years agoMerge branch 'ebassi/docs-related' into 'main'
Matthias Clasen [Wed, 23 Feb 2022 03:28:47 +0000 (03:28 +0000)]
Merge branch 'ebassi/docs-related' into 'main'

docs: Split dependencies from related libraries

See merge request GNOME/gtk!4474

3 years agoMerge branch 'wip/chergert/macos-iosurface' into 'main'
Matthias Clasen [Wed, 23 Feb 2022 03:10:43 +0000 (03:10 +0000)]
Merge branch 'wip/chergert/macos-iosurface' into 'main'

macos: modernize rendering with CALayer and IOSurface

See merge request GNOME/gtk!4477

3 years agomacos: improve placement of windows
Christian Hergert [Wed, 23 Feb 2022 02:41:41 +0000 (18:41 -0800)]
macos: improve placement of windows

This does some very basic window management so that we place surfaces in
locations where they can actually be interacted with correctly.

3 years agomacos: update CGL context when surface resizes
Christian Hergert [Tue, 22 Feb 2022 21:15:25 +0000 (13:15 -0800)]
macos: update CGL context when surface resizes

3 years agomacos: force pixel format without depth/stencil
Christian Hergert [Tue, 22 Feb 2022 21:09:30 +0000 (13:09 -0800)]
macos: force pixel format without depth/stencil

We don't need either depth or stencil buffers, so we want a pixel format
without them so that things like glClear() can do less work.

3 years agoUpdate Hebrew translation
Yosef Or Boczko [Tue, 22 Feb 2022 20:22:59 +0000 (20:22 +0000)]
Update Hebrew translation

3 years agoUpdate Persian translation
Danial Behzadi [Tue, 22 Feb 2022 20:08:03 +0000 (20:08 +0000)]
Update Persian translation

3 years agomacos: only invalidate tiles when size changes
Christian Hergert [Tue, 22 Feb 2022 08:51:53 +0000 (00:51 -0800)]
macos: only invalidate tiles when size changes

If the size changes, we need to relayout the tiles. Otherwise we can keep
using what we had before. Generally, that shouldn't happen, but the
previous check was failing in a number of ways.

3 years agomacos: reload IOSurface when monitor configuration changes
Christian Hergert [Tue, 22 Feb 2022 08:33:03 +0000 (00:33 -0800)]
macos: reload IOSurface when monitor configuration changes

We also want to reload buffer contents if the display server changes the
monitor configuration, such as after changing resolution or orientation.

3 years agomacos: double buffer IOSurface
Christian Hergert [Tue, 22 Feb 2022 07:53:55 +0000 (23:53 -0800)]
macos: double buffer IOSurface

It looks like, particularly on the M1, we might need to double buffer the
contents of the IOSurface<->OpenGL texture bindings. This doesn't appear
to show up on the Intel macbooks I've tried, but I've seen it in the wild
on an M1.

3 years agomacos: restore key window after hiding popup
Christian Hergert [Thu, 17 Feb 2022 02:26:59 +0000 (18:26 -0800)]
macos: restore key window after hiding popup

This fixes the focus returning to the parent window after the popup has
been hidden in the form of being a "Key Window" in macOS.

3 years agomacos: fix window drag across mixed-scale monitors
Christian Hergert [Thu, 17 Feb 2022 01:09:48 +0000 (17:09 -0800)]
macos: fix window drag across mixed-scale monitors

If we have a 2x scale laptop with a 1x scale external display, we would
need to create a new IOSurface for the external display once it crosses
a boundary, otherwise we won't have something capable of displaying
correctly on the second monitor.

3 years agomacos: use CALayer and IOSurface for rendering
Christian Hergert [Mon, 14 Feb 2022 10:20:19 +0000 (02:20 -0800)]
macos: use CALayer and IOSurface for rendering

This provides a major shift in how we draw both when accelerated OpenGL
as well as software rendering with Cairo. In short, it uses tiles of Core
Animation's CALayer to display contents from an OpenGL or Cairo rendering
so that the window can provide partial damage updates. Partial damage is
not generally available when using OpenGL as the whole buffer is flipped
even if you only submitted a small change using a scissor rect.

Thankfully, this speeds up Cairo rendering a bit too by using IOSurface to
upload contents to the display server. We use the tiling system we do for
OpenGL which reduces overall complexity and differences between them.

A New Buffer
============

GdkMacosBuffer is a wrapper around an IOSurfaceRef. The term buffer was
used because 1) surface is already used and 2) it loosely maps to a
front/back buffer semantic.

However, it appears that IOSurfaceRef contents are being retained in
some fashion (likely in the compositor result) so we can update the same
IOSurfaceRef without flipping as long as we're fast. This appears to be
what Chromium does as well, but Firefox uses two IOSurfaceRef and flips
between them. We would like to avoid two surfaces because it doubles the
GPU VRAM requirements of the application.

Changes to Windows
==================

Previously, the NSWindow would dynamically change between different
types of NSView based on the renderer being used. This is no longer
necessary as we just have a single NSView type, GdkMacosView, which
inherits from GdkMacosBaseView just to keep the tedius stuff separate
from the machinery of GdkMacosView. We can merge those someday if we
are okay with that.

Changes to Views
================

GdkMacosCairoView, GdkMacosCairoSubView, GdkMacosGLView have all been
removed and replaced with GdkMacosView. This new view has a single
CALayer (GdkMacosLayer) attached to it which itself has sublayers.

The contents of the CALayer is populated with an IOSurfaceRef which
we allocated with the GdkMacosSurface. The surface is replaced when
the NSWindow resizes.

Changes to Layers
=================

We now have a dedicated GdkMacosLayer which contains sublayers of
GdkMacosTile. The tile has a maximum size of 128x128 pixels in device
units.

The GdkMacosTile is partitioned by splitting both the transparent
region (window bounds minus opaque area) and then by splitting the
opaque area.

A tile has either translucent contents (and therefore is not opaque) or
has opaque contents (and therefore is opaque). An opaque tile never
contains transparent contents. As such, the opaque tiles contain a black
background so that Core Animation will consider the tile's bounds as
opaque. This can be verified with "Quartz Debug -> Show opaque regions".

Changes to Cairo
================

GTK 4 cannot currently use cairo-quartz because of how CSS borders are
rendered. It simply causes errors in the cairo_quartz_surface_t backend.

Since we are restricted to using cairo_image_surface_t (which happens to
be faster anyway) we can use the IOSurfaceBaseAddress() to obtain a
mapping of the IOSurfaceRef in user-space. It always uses BGRA 32-bit
with alpha channel even if we will discard the alpha channel as that is
necessary to hit the fast paths in other parts of the platform. Note
that while Cairo says CAIRO_FORMAT_ARGB32, it is really 32-bit BGRA on
little-endian as we expect.

OpenGL will render flipped (Quartz Native Co-ordinates) while Cairo
renders with 0,O in the top-left. We could use cairo_translate() and
cairo_scale() to reverse this, but it looks like some cairo things may
not look quite as right if we do so. To reduce the chances of one-off
bugs this continues to draw as Cairo would normally, but instead uses
an CGAffineTransform in the tiles and some CGRect translation when
swapping buffers to get the same effect.

Changes to OpenGL
=================

To simplify things, removal of all NSOpenGL* related components have
been removed and we strictly use the Core GL (CGL*) API. This probably
should have been done long ago anyay.

Most examples found in the browsers to use IOSurfaceRef with OpenGL are
using Legacy GL and there is still work underway to make this fit in
with the rest of how the GSK GL renderer works.

Since IOSurfaceRef bound to a texture/framebuffer will not have a
default framebuffer ID of 0, we needed to add a default framebuffer id
to the GdkGLContext. GskGLRenderer can use this to setup the command
queue in such a way that our IOSurface destination has been
glBindFramebuffer() as if it were the default drawable.

This stuff is pretty slight-of-hand, so where things are and what needs
flushing when and where has been a bit of an experiment to see what
actually works to get synchronization across subsystems.

Efficient Damages
=================

After we draw with Cairo, we unlock the IOSurfaceRef and the contents
are uploaded to the GPU. To make the contents visible to the app,
we must clear the tiles contents with `layer.contents=nil;` and then
re-apply the IOSurfaceRef. Since the buffer has likely not changed, we
only do this if the tile overlaps the damage region.

This gives the effect of having more tightly controlled damage regions
even though updating the layer would damage be the whole window (as it
is with OpenGL/Metal today with the exception of scissor-rect).

This too can be verified usign "Quartz Debug -> Flash screen udpates".

Frame Synchronized Resize
=========================

In GTK 4, we have the ability to perform sizing changes from compute-size
during the layout phase. Since the macOS backend already tracks window
resizes manually, we can avoid doing the setFrame: immediately and instead
do it within the frame clock's layout phase.

Doing so gives us vastly better resize experience as we're more likely to
get the size-change and updated-contents in the same frame on screen. It
makes things feel "connected" in a way they weren't before.

Some additional effort to tweak gravity during the process is also
necessary but we were already doing that in the GTK 4 backend.

Backporting
===========

The design here has made an attempt to make it possible to backport by
keeping GdkMacosBuffer, GdkMacosLayer, and GdkMacosTile fairly
independent. There may be an opportunity to integrate this into GTK 3's
quartz backend with a fair bit of work. Doing so could improve the
situation for applications which are damage-rich such as The GIMP.

3 years agogsk/gl: support non-standard default framebuffer
Christian Hergert [Fri, 11 Feb 2022 05:51:15 +0000 (21:51 -0800)]
gsk/gl: support non-standard default framebuffer

There are situations where our "default framebuffer" is not actually
zero, yet we still want to apply a scissor rect.

Generally, 0 is the default framebuffer. But on platforms where we need
to bind a platform-specific feature to a GL_FRAMEBUFFER, we might have a
default that is not 0. For example, on macOS we bind an IOSurfaceRef to
a GL_TEXTURE_RECTANGLE which then is assigned as the backing store for a
framebuffer. This is different than using gsk_gl_renderer_render_texture()
in that we don't want to incur an extra copy to the destination surface
nor do we even have a way to pass a texture_id into render_texture().

3 years agomacos: fix allocation for filechoosernative filter
Christian Hergert [Thu, 17 Feb 2022 20:39:21 +0000 (12:39 -0800)]
macos: fix allocation for filechoosernative filter

The GtkFileCHooserNativeQuartz injects a NSComboBox into the NSSavePanel
(which is displayed in a remote process since 10.15 whether or not you are
a sandboxed application). The style has changed and we need more space
here to not clip part of the combobox out of view.

I tried every size from 22 to 30 and this seemed to look the most natural
without skewing the location of the text within the combobox.

3 years agoMerge branch 'scale-button-empty-icon-list' into 'main'
Matthias Clasen [Tue, 22 Feb 2022 19:39:32 +0000 (19:39 +0000)]
Merge branch 'scale-button-empty-icon-list' into 'main'

Don't crash when updating the icon on a `GtkScaleButton` with a non-`NULL` empty icon list

See merge request GNOME/gtk!4475

3 years agoMerge branch 'wip/hadess/app-id-inspector-4' into 'main'
Matthias Clasen [Tue, 22 Feb 2022 19:37:36 +0000 (19:37 +0000)]
Merge branch 'wip/hadess/app-id-inspector-4' into 'main'

inspector: Show app ID and resource path in the General tab

See merge request GNOME/gtk!4493

3 years agoMerge branch 'wip/chergert/macos-fix-event-filter' into 'main'
Matthias Clasen [Tue, 22 Feb 2022 19:36:43 +0000 (19:36 +0000)]
Merge branch 'wip/chergert/macos-fix-event-filter' into 'main'

macos: improve event filtering for foreign panels

See merge request GNOME/gtk!4495

3 years agoMerge branch 'wip/chergert/macos-fix-fullscreen' into 'main'
Matthias Clasen [Tue, 22 Feb 2022 19:36:20 +0000 (19:36 +0000)]
Merge branch 'wip/chergert/macos-fix-fullscreen' into 'main'

macos: allow windows to enter fullscreen

See merge request GNOME/gtk!4494

3 years agoMerge branch 'optimise-png-premultiply' into 'main'
Matthias Clasen [Tue, 22 Feb 2022 19:25:41 +0000 (19:25 +0000)]
Merge branch 'optimise-png-premultiply' into 'main'

gdk: Specialise RGBA8 → premultiplied BGRA8 conversion

See merge request GNOME/gtk!4481

3 years agoMerge branch 'ebassi/graphene-build-opts' into 'main'
Matthias Clasen [Tue, 22 Feb 2022 18:05:14 +0000 (18:05 +0000)]
Merge branch 'ebassi/graphene-build-opts' into 'main'

build: Disable graphene tests

See merge request GNOME/gtk!4500

3 years agoMerge branch 'emoji-40' into 'main'
Matthias Clasen [Tue, 22 Feb 2022 18:04:24 +0000 (18:04 +0000)]
Merge branch 'emoji-40' into 'main'

emoji: Update data to CLDRv40 and add more locales

Closes #4568

See merge request GNOME/gtk!4507

3 years agoMerge branch 'wip/chergert/gsk-gl-less-glClear' into 'main'
Matthias Clasen [Tue, 22 Feb 2022 17:56:40 +0000 (17:56 +0000)]
Merge branch 'wip/chergert/gsk-gl-less-glClear' into 'main'

gsk/gl: avoid clearing opaque regions

See merge request GNOME/gtk!4504

3 years agoMerge branch 'wip/chergert/macos-fix-backdrop' into 'main'
Matthias Clasen [Tue, 22 Feb 2022 17:54:20 +0000 (17:54 +0000)]
Merge branch 'wip/chergert/macos-fix-backdrop' into 'main'

macos: fix backdrop when displaying popover

See merge request GNOME/gtk!4505

3 years agoMerge branch 'wip/chergert/macos-fix-toplevel-resize' into 'main'
Matthias Clasen [Tue, 22 Feb 2022 13:10:34 +0000 (13:10 +0000)]
Merge branch 'wip/chergert/macos-fix-toplevel-resize' into 'main'

macos: fix configure, move-resize, and compute-size

See merge request GNOME/gtk!4486

3 years agoemoji: Add more locales
Kévin Commaille [Tue, 22 Feb 2022 09:56:39 +0000 (10:56 +0100)]
emoji: Add more locales

Based on the locales that are at least 85% translated in Damned Lies:
https://l10n.gnome.org/releases/gnome-41/
Limited by the locales available in emojibase

Closes #4568

3 years agoemoji: Update data to CLDR v40
Kévin Commaille [Tue, 22 Feb 2022 09:48:14 +0000 (10:48 +0100)]
emoji: Update data to CLDR v40

Based on emojibase-data v7.0.1
Contains the changes in Unicode 14.0

https://unicode.org/versions/Unicode14.0.0/
https://cldr.unicode.org/index/downloads/cldr-40
https://github.com/milesj/emojibase/blob/b85382524c/packages/data/CHANGELOG.md

3 years agoemoji: Fix the convert-emoji program
Kévin Commaille [Tue, 22 Feb 2022 09:44:43 +0000 (10:44 +0100)]
emoji: Fix the convert-emoji program

The annotation field has been renamed to label in emojibase-data

https://github.com/milesj/emojibase/blob/b85382524c/packages/data/CHANGELOG.md

3 years agomacos: fix backdrop when displaying popover
Christian Hergert [Tue, 22 Feb 2022 08:08:00 +0000 (00:08 -0800)]
macos: fix backdrop when displaying popover

Previously, the popover would cause the window to go into the :backdrop
state which is not what we want for consistency with other platforms. This
fixes that by walking up the surface chain when we get notified of
loosing or acquiring "key" input from the display server.

3 years agoMerge branch 'gdk-win32-implicit-grabs-cleanup' into 'main'
Luca Bacci [Tue, 22 Feb 2022 07:53:54 +0000 (07:53 +0000)]
Merge branch 'gdk-win32-implicit-grabs-cleanup' into 'main'

GdkWin32: Remove implicit_grab_surface

Closes #4188

See merge request GNOME/gtk!4503

3 years agoMerge branch 'win32-ime-fix-popup-positioning' into 'main'
Luca Bacci [Tue, 22 Feb 2022 07:52:59 +0000 (07:52 +0000)]
Merge branch 'win32-ime-fix-popup-positioning' into 'main'

Win32 IME: Fix popup positioning

Closes #374 and #2338

See merge request GNOME/gtk!4501

3 years agogsk/gl: avoid clearing opaque regions
Christian Hergert [Tue, 22 Feb 2022 07:27:42 +0000 (23:27 -0800)]
gsk/gl: avoid clearing opaque regions

If the rendering operation is over an opaque region, we can potentially
avoid clearing a large section of the framebuffer destination. Some cases
you do want to clear, such as when clearing the whole contents as some
drivers have fast paths for that to avoid bringing data back into the
framebuffer.

3 years agoGdkWin32: Remove implicit_grab_surface
Luca Bacci [Mon, 21 Feb 2022 16:38:50 +0000 (17:38 +0100)]
GdkWin32: Remove implicit_grab_surface

3 years agoWin32 IME: Fix popup position
Luca Bacci [Mon, 21 Feb 2022 11:53:02 +0000 (12:53 +0100)]
Win32 IME: Fix popup position

3 years agoWin32 IME: Rename a variable
Luca Bacci [Mon, 21 Feb 2022 11:40:54 +0000 (12:40 +0100)]
Win32 IME: Rename a variable

3 years agoWin32 IME: Keep track of the client widget
Luca Bacci [Mon, 21 Feb 2022 11:39:52 +0000 (12:39 +0100)]
Win32 IME: Keep track of the client widget

3 years agoWin32 IME: Remove the get_window_position util function
Luca Bacci [Mon, 21 Feb 2022 11:32:20 +0000 (12:32 +0100)]
Win32 IME: Remove the get_window_position util function

It always returns (0, 0)

3 years agobuild: Disable graphene tests
Emmanuele Bassi [Mon, 21 Feb 2022 13:41:40 +0000 (13:41 +0000)]
build: Disable graphene tests

When building Graphene as a subproject we don't really need
to build tests. Disabling tests also removes the dependency
on mutest.

3 years agoMerge branch 'msvc-cmake-dep' into 'main'
Emmanuele Bassi [Mon, 21 Feb 2022 13:37:12 +0000 (13:37 +0000)]
Merge branch 'msvc-cmake-dep' into 'main'

Meson: Use CMake more for finding deps on Visual Studio-like builds

See merge request GNOME/gtk!4499

3 years agoMerge branch 'forward-port-mr-775-to-gtk4' into 'main'
Luca Bacci [Mon, 21 Feb 2022 12:01:21 +0000 (12:01 +0000)]
Merge branch 'forward-port-mr-775-to-gtk4' into 'main'

gtkimcontextime.c: Fix preedit window placement on HiDPI

See merge request GNOME/gtk!4498

3 years agomeson.build: Use CMake to find libjpeg on MSVC-like builds
Chun-wei Fan [Mon, 21 Feb 2022 09:50:15 +0000 (17:50 +0800)]
meson.build: Use CMake to find libjpeg on MSVC-like builds

One may be using IJG libjpeg or libjpeg-turbo to build GTK, and their
build files may or may not generate pkg-config files for us.  To make
things easier, we can make use of CMake's built-in support for finding
IJG libjpeg or libjpeg-turbo.

3 years agomeson.build: Use CMake to find libtiff on MSVC-like
Chun-wei Fan [Mon, 21 Feb 2022 09:46:11 +0000 (17:46 +0800)]
meson.build: Use CMake to find libtiff on MSVC-like

The CMake build files for libtiff may or may not generate pkg-config
files for us, so we can use Meson's CMake support to help us find
libtiff, as CMake has built-in support for finding libtiff.

3 years agomeson.build: Consolidate items with MSVC-like compilers
Chun-wei Fan [Mon, 21 Feb 2022 09:41:00 +0000 (17:41 +0800)]
meson.build: Consolidate items with MSVC-like compilers

Add a variable in meson.build that covers Visual Studio-like compilers,
so that we can use it to help us find depedencies using CMake rather
than via pkg-config, where applicable.

Change the existing use case for finding libpng accordingly.

3 years agoUpdate Turkish translation
Emin Tufan Çetin [Sun, 20 Feb 2022 15:04:41 +0000 (15:04 +0000)]
Update Turkish translation

3 years agoUpdate Turkish translation
Emin Tufan Çetin [Sun, 20 Feb 2022 14:47:56 +0000 (14:47 +0000)]
Update Turkish translation

3 years agoUpdate Persian translation
Danial Behzadi [Sun, 20 Feb 2022 11:14:09 +0000 (11:14 +0000)]
Update Persian translation

3 years agogtkimcontextime.c: Fix preedit window placement on HiDPI
Chun-wei Fan [Sat, 19 Feb 2022 17:31:28 +0000 (18:31 +0100)]
gtkimcontextime.c: Fix preedit window placement on HiDPI

We must also take the scaling factor into account for placing the IME
preedit window that is often used for Chinese and Japanese input on
Windows.

3 years agomacos: improve event filtering for foreign panels
Christian Hergert [Fri, 18 Feb 2022 11:39:00 +0000 (03:39 -0800)]
macos: improve event filtering for foreign panels

We might have panels with controls in them where the window is running in
another process. The control could have a wrapper window which we would
see from this process. This can happen with the GtkFileChooserNative, but
any NSSavePanel in macOS 10.15+ is out of process (not just sandboxed
applications).

3 years agomacos: fix configure, move-resize, and compute-size
Christian Hergert [Wed, 16 Feb 2022 10:50:51 +0000 (02:50 -0800)]
macos: fix configure, move-resize, and compute-size

This significantly cleans up how we handle various move-resize, compute-
size, and configure (notification of changes) in the macOS GDK backend.

Originally when prototyping this backend, there were some bits that came
over from the quartz backend and some bits which did not. It got confusing
and so this makes an attempt to knock down all that technical debt.

It is much simpler now in that the GdkMacosSurface makes requests of the
GdkMacosWindow, and the GdkMacosWindow notifies the GdkMacosSurface of
changes that happen.

User resizes are delayed until the next compute-size so that we are much
closer to the layout phase, reducing chances for in-between frames.

This also improves the situation of leaving maximized state so that a
grab and drag feels like you'd expect on other platforms.

I removed the opacity hack we had in before, because that is all coming
out anyway and it's a bit obnoxious to maintain through the async flows
here.

3 years agomacos: allow windows to enter fullscreen
Christian Hergert [Fri, 18 Feb 2022 09:52:48 +0000 (01:52 -0800)]
macos: allow windows to enter fullscreen

This fixes GTK's NSWindow for toplevels so that they are allowed to enter
fullscreen. We were already handlign the state transitions from the
setStyleMask: halper, but we didn't previously tell the window we are
allowed to transition into that.

There is a bit of a mismatch here in that GTK doesn't have any such flag
that determines if a window is "allowed" by policy to enter fullscreen
since window managers on Linux are free to do that at will.

3 years agoinspector: Show app ID and resource path in the General tab
Bastien Nocera [Thu, 17 Feb 2022 11:24:51 +0000 (12:24 +0100)]
inspector: Show app ID and resource path in the General tab

This makes it easier to figure out those values (which are mentioned in
the GtkApplication documentation) rather than working that out from the
way they're generated (or documented as being generated).

3 years agoMerge branch 'wip/chergert/macos-gst-cgl' into 'main'
Matthias Clasen [Thu, 17 Feb 2022 13:54:42 +0000 (13:54 +0000)]
Merge branch 'wip/chergert/macos-gst-cgl' into 'main'

media: support OpenGL-based video playback on macOS

See merge request GNOME/gtk!4491

3 years agoMerge branch 'wip/chergert/macos-fix-popup-input' into 'main'
Matthias Clasen [Thu, 17 Feb 2022 13:53:04 +0000 (13:53 +0000)]
Merge branch 'wip/chergert/macos-fix-popup-input' into 'main'

macos: fix keyboard input on popovers

See merge request GNOME/gtk!4490

3 years agomedia: support OpenGL-based video playback on macOS
Christian Hergert [Thu, 17 Feb 2022 05:27:10 +0000 (21:27 -0800)]
media: support OpenGL-based video playback on macOS

If we have GStreamer on macOS we likely have support for CGL to get an
OpenGL context we can use. This provides the missing pieces to get
accelerated video playback in gtk4-widget-factory working.

3 years agomacos: fix keyboard input on popovers
Christian Hergert [Thu, 17 Feb 2022 01:52:42 +0000 (17:52 -0800)]
macos: fix keyboard input on popovers

GdkPopup can also become the "key" window (just not the "main" window).

3 years agogdk: Optimise RGBA8 → premultiplied BGRA8 for ARM
Emmanuel Gil Peyrot [Tue, 15 Feb 2022 19:58:56 +0000 (20:58 +0100)]
gdk: Optimise RGBA8 → premultiplied BGRA8 for ARM

This more than halves the total runtime of this function since the
previous commit, from 8.36% to 4.02%, and is most likely memory
bandwidth limited on this specific board now.

I tried to do a SSE2 version as well, but couldn’t find any equivalent
of the LD4/ST4 ARM instruction.

3 years agogdk: Specialise RGBA8 → premultiplied BGRA8 conversion
Emmanuel Gil Peyrot [Tue, 15 Feb 2022 19:54:18 +0000 (20:54 +0100)]
gdk: Specialise RGBA8 → premultiplied BGRA8 conversion

On x86 on a Kaby Lake CPU, this makes it go from 6.63% of the total
execution time (loading some PNGs using the cairo backend) down to
3.20%.

On ARM on a Cortex-A7, on the same workload, this makes it go from 57%
to 8.36%.

3 years agoMerge branch 'wip/chergert/for-macos-1' into 'main'
Matthias Clasen [Wed, 16 Feb 2022 13:54:43 +0000 (13:54 +0000)]
Merge branch 'wip/chergert/for-macos-1' into 'main'

macos: various correctness fixes

See merge request GNOME/gtk!4485

3 years agoMerge branch 'wip/baedert/for-master' into 'main'
Matthias Clasen [Wed, 16 Feb 2022 13:48:51 +0000 (13:48 +0000)]
Merge branch 'wip/baedert/for-master' into 'main'

gtkgstpaintable: Handle a NULL value

See merge request GNOME/gtk!4484

3 years agomacos: add helper to check if surface is opaque
Christian Hergert [Mon, 14 Feb 2022 10:18:51 +0000 (02:18 -0800)]
macos: add helper to check if surface is opaque

3 years agomacos: use input_region to specify tracking areas
Christian Hergert [Sat, 5 Feb 2022 01:24:13 +0000 (17:24 -0800)]
macos: use input_region to specify tracking areas

We want our tracking area to be limited to the input region so that we
don't pass along events outside of them for the window. This improves the
chances we click-out of a popover with a large shadow.

This still doesn't let us pass-through clicks for large shadows on top-
level windows though.

3 years agomacos: ignore mouse events outside tracking area
Christian Hergert [Mon, 14 Feb 2022 10:16:07 +0000 (02:16 -0800)]
macos: ignore mouse events outside tracking area

We also need to ignore events outside the tracking areas when we are
translating them from NSevent into GdkEvent.

3 years agomacos: fix incorrect signal disconnect
Christian Hergert [Wed, 16 Feb 2022 09:46:25 +0000 (01:46 -0800)]
macos: fix incorrect signal disconnect

3 years agogtkgstpaintable: Handle a NULL value
Timm Bäder [Wed, 16 Feb 2022 09:01:13 +0000 (10:01 +0100)]
gtkgstpaintable: Handle a NULL value

gst_element_factory_make can return NULL.

3 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Wed, 16 Feb 2022 03:07:05 +0000 (03:07 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

glcontext: Remove leftover function call

Closes #4697

See merge request GNOME/gtk!4483

3 years agoglcontext: Remove leftover function call
Benjamin Otte [Wed, 16 Feb 2022 02:46:29 +0000 (03:46 +0100)]
glcontext: Remove leftover function call

That call should have been removed way back when.

Add a testcase to make sure this keeps working.

Fixes #4697

3 years agomacos: remove assertion from external API
Christian Hergert [Tue, 15 Feb 2022 20:12:45 +0000 (12:12 -0800)]
macos: remove assertion from external API

We only should be asserting in static functions. Furthermore, this function
did not need to have GDK_BEGIN_MACOS_ALLOC_POOL as nothing is being
allocated there which would cause pooling to get used.

3 years agomacos: improve monitor detection at display coordinates
Christian Hergert [Tue, 15 Feb 2022 20:11:36 +0000 (12:11 -0800)]
macos: improve monitor detection at display coordinates

This needs to handle the boundary case where the value is exactly equal
to the edge of a rectangle (which gdk_rectangle_contains_point() does not
consider to be containing). However, if there is a monitor in the list
that is a better match, we still want to prefer it.

3 years agoMerge branch 'viewport-scroll-to-focus' into 'main'
Benjamin Otte [Tue, 15 Feb 2022 16:05:32 +0000 (16:05 +0000)]
Merge branch 'viewport-scroll-to-focus' into 'main'

scrolledwindow: Set scroll-to-focus on viewports

See merge request GNOME/gtk!4356

3 years agoviewport: Set scroll-to-focus to TRUE by default
Maximiliano Sandoval R [Sat, 8 Jan 2022 11:56:43 +0000 (12:56 +0100)]
viewport: Set scroll-to-focus to TRUE by default

In GTK 3 this was the default.

3 years agoMerge branch 'mac-scrolling-fix' into 'main'
Christian Hergert [Mon, 14 Feb 2022 23:00:27 +0000 (23:00 +0000)]
Merge branch 'mac-scrolling-fix' into 'main'

gdk: fix reversed and sluggish scrolling on MacOS

See merge request GNOME/gtk!4479

3 years agogdk: fix reversed and sluggish scrolling on MacOS
Andy Russell [Mon, 14 Feb 2022 17:43:07 +0000 (12:43 -0500)]
gdk: fix reversed and sluggish scrolling on MacOS

When using an external mouse on MacOS, the scrolling behavior is
reversed from the user's scrolling preference. Additionally, it is
noticeably sluggish.

This commit fixes both issues by negating the deltas and multiplying
them by 32 before constructing a new scroll event. 32 seems to be the
"traditional" scaling factor according to [Druid], but I'm not sure
where that value actually comes from. Regardless, scaling the deltas by
this amount makes scrolling feel a lot more responsive in the GTK demos.

Scrolling with a trackpad is not affected by either issue because it
triggers a different code path that uses more precise deltas, and
already negates them.

[Druid]: https://linebender.gitbook.io/linebender-graphics-wiki/mouse-wheel#external-mouse-wheel-vs-trackpad

3 years agodocs: Add Since annotations to GDK_VERSION macros
Benjamin Otte [Sun, 13 Feb 2022 17:04:18 +0000 (18:04 +0100)]
docs: Add Since annotations to GDK_VERSION macros

3 years agoUpdate Slovenian translation
Matej Urbančič [Sun, 13 Feb 2022 18:58:22 +0000 (18:58 +0000)]
Update Slovenian translation

3 years agoUpdate Slovenian translation
Matej Urbančič [Sun, 13 Feb 2022 18:56:28 +0000 (18:56 +0000)]
Update Slovenian translation

3 years agoUpdate Basque translation
Asier Sarasua Garmendia [Sun, 13 Feb 2022 09:22:58 +0000 (09:22 +0000)]
Update Basque translation

3 years agoDon't crash when updating the icon on a `GtkScaleButton` with a non-`NULL` empty...
Sebastian Dröge [Sun, 13 Feb 2022 09:16:32 +0000 (11:16 +0200)]
Don't crash when updating the icon on a `GtkScaleButton` with a non-`NULL` empty icon list

3 years agoUpdated Czech translation
Marek Černocký [Sat, 12 Feb 2022 18:48:40 +0000 (19:48 +0100)]
Updated Czech translation

3 years agowidget-factory: Make <F11> toggle fullscreen
Benjamin Otte [Fri, 11 Feb 2022 00:13:13 +0000 (01:13 +0100)]
widget-factory: Make <F11> toggle fullscreen

3 years agodocs: Split dependencies from related libraries
Emmanuele Bassi [Sat, 12 Feb 2022 17:03:22 +0000 (17:03 +0000)]
docs: Split dependencies from related libraries

We currently list everything as a dependencies, regardless of whether
it actually is; this is a source of confusion for users that read the
GTK documentation.

Gi-docgen has a new "related" key in the project configuration which
allows us to list libraries that are merely related to the namespace
we are documenting; the "dependencies" key is used to document the
actual namespace dependencies, now.

3 years agoUpdate Catalan translation
Jordi Mas i Hernandez [Sat, 12 Feb 2022 14:41:46 +0000 (14:41 +0000)]
Update Catalan translation

3 years agoMerge branch 'wip/chergert/fix-text-overdraw' into 'main'
Matthias Clasen [Sat, 12 Feb 2022 08:34:18 +0000 (08:34 +0000)]
Merge branch 'wip/chergert/fix-text-overdraw' into 'main'

css: reduce overdraws from "textview > text"

See merge request GNOME/gtk!4472

3 years agocss: reduce overdraws from "textview > text"
Christian Hergert [Sat, 12 Feb 2022 07:02:20 +0000 (23:02 -0800)]
css: reduce overdraws from "textview > text"

This was causing us to draw the same background content twice which is a
significant amount of bits to flip in the GPU for maximized windows,
especially twice.

3 years ago4.6.1
Matthias Clasen [Sat, 12 Feb 2022 01:09:15 +0000 (20:09 -0500)]
4.6.1

3 years agoMerge branch 'wip/chergert/popover-opaque-region' into 'main'
Matthias Clasen [Fri, 11 Feb 2022 23:16:43 +0000 (23:16 +0000)]
Merge branch 'wip/chergert/popover-opaque-region' into 'main'

add opaque regions to popovers

Closes #4689

See merge request GNOME/gtk!4468

3 years agopopover: use GtkNative opaque region API
Christian Hergert [Fri, 11 Feb 2022 00:54:32 +0000 (16:54 -0800)]
popover: use GtkNative opaque region API

This updates GtkPopover to use the new GtkNative abstraction for
reporting opaque regions of the window, in hopes that it can speed
up compositors for things like animated lists, menu transitions,
and more.

Fixes #4689

3 years agowindow: use GtkNative API to update opaque region
Christian Hergert [Fri, 11 Feb 2022 00:23:16 +0000 (16:23 -0800)]
window: use GtkNative API to update opaque region

This switches to using the new GtkNative machinery for updating the
opaque region. Some amount of local calculation is still required for
determining when we should apply shadows, and this inherits what was
done previous for that.

Related #4689