gtk4.git
2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Tue, 11 Apr 2023 06:10:56 +0000 (06:10 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

filechooser: Fix the gridview

See merge request GNOME/gtk!5817

2 years agofilechooser: Fix the gridview
Matthias Clasen [Tue, 11 Apr 2023 05:41:09 +0000 (07:41 +0200)]
filechooser: Fix the gridview

2a70093a309481cf6 was a bit overeager in its porting
to GtkColumnViewCell. The gridview needs to keep its
list items.

2 years agoMerge branch 'wip/corey/file-chooser-widget' into 'main'
Matthias Clasen [Tue, 11 Apr 2023 05:32:38 +0000 (05:32 +0000)]
Merge branch 'wip/corey/file-chooser-widget' into 'main'

More fixes to filechooserwidget

See merge request GNOME/gtk!5815

2 years agoMerge branch 'wip/corey/filesystemmodel' into 'main'
Matthias Clasen [Tue, 11 Apr 2023 05:27:24 +0000 (05:27 +0000)]
Merge branch 'wip/corey/filesystemmodel' into 'main'

filesystemmodel: Notify correct position removed in remove_file()

See merge request GNOME/gtk!5814

2 years agofilechooser: Set date and time after cell is a child of filechooserwidget
Corey Berla [Tue, 11 Apr 2023 00:58:09 +0000 (17:58 -0700)]
filechooser: Set date and time after cell is a child of filechooserwidget

The date/time column relies on the filechooserwidget to format the date
properly.  During bind, the filechoosercell, get the filechooserwidget
ancestor, but now due to changes in the listview, the cell isn't a
child of the filechooserwidget at that point.  Since this is deeply
ingrained into the filechooserwidget, let's keep the same behavior,
but move it to filechoosercell in realize.  Alternatively, we could have
used a signal factory (with the file chooser widget as the user data),
but that would have been a major overhaul.

2 years agofilechoosercell: Store type_format in filechoosercell
Corey Berla [Mon, 10 Apr 2023 22:14:42 +0000 (15:14 -0700)]
filechoosercell: Store type_format in filechoosercell

The format of the type column depends on the the type_format, which
is stored in the filechooserwidget.  We get that setting by looking
for the filechooserwidget ancestor, which no longer works after recent
changes to the list views (it was fragile to begin with).  At one point,
the setting appears to have been dynamic, but now it is only loading
from GSettings, so let's simply do the same within FileChooserCell.

2 years agofilechooserwidget: Finish port to GtkColumnViewCell
Corey Berla [Mon, 10 Apr 2023 21:08:47 +0000 (14:08 -0700)]
filechooserwidget: Finish port to GtkColumnViewCell

Some missing updates from f5dea9a3c217c49f44eedb18822be080d2451dc0

2 years agofilesystemmodel: Notify correct position removed in remove_file()
Corey Berla [Mon, 10 Apr 2023 19:56:08 +0000 (12:56 -0700)]
filesystemmodel: Notify correct position removed in remove_file()

32247bc50e63b709ae738a95a2ec71345b5fad75 made several changes to account for the
fact that we no longer have a NULL editable at the beginning of the list
model.  The commit mistakenly left out one change in remove_file(),
which causes the wrong file to be removed.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Mon, 10 Apr 2023 14:28:38 +0000 (14:28 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

node-editor: Typo fixes

See merge request GNOME/gtk!5812

2 years agonode-editor: Typo fixes
Matthias Clasen [Mon, 10 Apr 2023 05:53:23 +0000 (07:53 +0200)]
node-editor: Typo fixes

Fix some typos in the node format documentation.

2 years agoMerge branch 'scrolled-window-critical' into 'main'
Matthias Clasen [Mon, 10 Apr 2023 05:50:20 +0000 (05:50 +0000)]
Merge branch 'scrolled-window-critical' into 'main'

scrolledwindow: Avoid a critical

See merge request GNOME/gtk!5809

2 years agotestsuite: Check widget properties better
Matthias Clasen [Mon, 10 Apr 2023 04:24:57 +0000 (00:24 -0400)]
testsuite: Check widget properties better

Check that setting a property after resetting
it works. An instance of this was fixed in the
previous commit.

2 years agoscrolledwindow: Avoid a critical
Matthias Clasen [Mon, 10 Apr 2023 04:22:20 +0000 (00:22 -0400)]
scrolledwindow: Avoid a critical

When setting the child property to NULL, we also need
to unset auto_added_viewport, to avoid triggering a
critical when setting it again.

2 years agoMerge branch 'warn-show-destoyed-window' into 'main'
Matthias Clasen [Sun, 9 Apr 2023 20:16:52 +0000 (20:16 +0000)]
Merge branch 'warn-show-destoyed-window' into 'main'

Show a warning when a destroyed window is shown

See merge request GNOME/gtk!5122

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sun, 9 Apr 2023 13:02:55 +0000 (13:02 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

gtk-demo: Add a keyword

See merge request GNOME/gtk!5805

2 years agogtk-demo: Stop using gtk_widget_get_allocation
Matthias Clasen [Sun, 9 Apr 2023 11:32:38 +0000 (07:32 -0400)]
gtk-demo: Stop using gtk_widget_get_allocation

2 years agogtk-demo: Add a keyword
Matthias Clasen [Sun, 9 Apr 2023 11:32:25 +0000 (07:32 -0400)]
gtk-demo: Add a keyword

Make the demo using the 'bluroverlay' come up when you type 'blur'.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sun, 9 Apr 2023 12:37:44 +0000 (12:37 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

range: Fix a copy-paste error

See merge request GNOME/gtk!5803

2 years agoplacessidebar: Stop using gtk_widget_get_allocation
Matthias Clasen [Sun, 9 Apr 2023 00:17:33 +0000 (20:17 -0400)]
placessidebar: Stop using gtk_widget_get_allocation

2 years agocoloreditor: Stop using gtk_widget_get_allocation
Matthias Clasen [Sat, 8 Apr 2023 23:56:29 +0000 (19:56 -0400)]
coloreditor: Stop using gtk_widget_get_allocation

2 years agorange: Fix a copy-paste error
Matthias Clasen [Sat, 8 Apr 2023 23:50:16 +0000 (19:50 -0400)]
range: Fix a copy-paste error

This was showing up as the alpha popup in
the color editor not being positioned correctly.

2 years agoMerge branch 'gbsneto/vulkan-glyph-fixes' into 'main'
Benjamin Otte [Sun, 9 Apr 2023 00:07:16 +0000 (00:07 +0000)]
Merge branch 'gbsneto/vulkan-glyph-fixes' into 'main'

Vulkan glyph fixes

See merge request GNOME/gtk!5802

2 years agogsk/vulkan/glyphcache: Rework glyphs
Georges Basile Stavracas Neto [Sat, 8 Apr 2023 22:52:48 +0000 (19:52 -0300)]
gsk/vulkan/glyphcache: Rework glyphs

The current implementation of the glyph cache deals with atlases by
padding them with 1 pixel at the beginning, at the end, and between
each glyph.

That's cool and all, however, there's a very subtle problem with
this approach: the contents of the atlas are garbage, so this padding
is filled with garbage memory!

Rework the Vulkan glyph cache to draw each and every glyph in a
surface that has 1 pixel border of padding around it. Ensure the
surface is completely black by drawing a rectangle before handing
it to Pango to draw the glyph. Update tx and ty to pick the texture
position adjusted to the 1 pixel padding. The atlas now starts at
position (0, 0), since each glyph individually contains its own padding.

To improve legibility, add a PADDING define and use it everywhere.

2 years agogsk/vulkan/pipeline: Simplify pipeline creation
Georges Basile Stavracas Neto [Wed, 5 Apr 2023 15:13:48 +0000 (12:13 -0300)]
gsk/vulkan/pipeline: Simplify pipeline creation

Nothing uses gsk_vulkan_pipeline_new_full() anymore.

2 years agogsk/vulkan: Use default blend factors
Georges Basile Stavracas Neto [Wed, 5 Apr 2023 14:49:26 +0000 (11:49 -0300)]
gsk/vulkan: Use default blend factors

Vulkan renders text using VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA and
VK_BLEND_FACTOR_SRC_ALPHA, but that implies per-channel alpha
blending, which currently produces the wrong results when blending
glyphs with the images beneath them.

Use the default pipeline constructors, which implies using the
ONE and ONE_MINUS_SRC_ALPHA.

2 years agogsk/vulkan: Cosmetics
Georges Basile Stavracas Neto [Sat, 8 Apr 2023 23:09:40 +0000 (20:09 -0300)]
gsk/vulkan: Cosmetics

Reorder code to match the order used in shaders.

2 years agoTweak the wording of the message.
Matthias Clasen [Sat, 8 Apr 2023 16:14:52 +0000 (16:14 +0000)]
Tweak the wording of the message.

2 years agoMerge branch 'wip/carlosg/popover-ungrab-on-unmap' into 'main'
Matthias Clasen [Fri, 7 Apr 2023 20:24:24 +0000 (20:24 +0000)]
Merge branch 'wip/carlosg/popover-ungrab-on-unmap' into 'main'

gtkpopover: Move GTK grabs to map/unmap

Closes #5730

See merge request GNOME/gtk!5801

2 years agogtkpopover: Move GTK grabs to map/unmap
Carlos Garnacho [Fri, 7 Apr 2023 19:42:10 +0000 (21:42 +0200)]
gtkpopover: Move GTK grabs to map/unmap

Typically, a popover gets mapped when shown and unmapped when
hidden. A situation there that breaks is where the popover gets
recursively unmapped/unrealized when its root is destroyed.

In that situation, the popover does however unmap (without being
hidden first), moving the GTK grab from show/hide to map/unmap
will handle the previous situations, plus this one.

Fixes things being unclickable if e.g. a modal dialog got a
popover popped up, then got closed via Alt-F4.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5730
2 years agoMerge branch 'inspector-action-fixes' into 'main'
Matthias Clasen [Fri, 7 Apr 2023 18:05:19 +0000 (18:05 +0000)]
Merge branch 'inspector-action-fixes' into 'main'

actionmuxer: Make the compiler warn

See merge request GNOME/gtk!5800

2 years agoinspector: Redo the actions list
Matthias Clasen [Fri, 7 Apr 2023 17:14:51 +0000 (13:14 -0400)]
inspector: Redo the actions list

Make the actions list implement GtkActionObserver
for the muxer case, and make updates work.

2 years agoinspector: Simplify the action editor
Matthias Clasen [Fri, 7 Apr 2023 16:58:10 +0000 (12:58 -0400)]
inspector: Simplify the action editor

No need to listen for changes, the actions list
code will do so and tell us to update.

2 years agoinspector: Add ActionHolder::changed
Matthias Clasen [Fri, 7 Apr 2023 17:14:07 +0000 (13:14 -0400)]
inspector: Add ActionHolder::changed

We will use this signal to communicate
action changes to the action list widgetry.

2 years agoinspector: Cosmetics
Matthias Clasen [Fri, 7 Apr 2023 17:15:34 +0000 (13:15 -0400)]
inspector: Cosmetics

Make the variant editor use a checkbutton
instead of a togglebutton.

2 years agoactionmuxer: Add a precondition
Matthias Clasen [Fri, 7 Apr 2023 16:53:57 +0000 (12:53 -0400)]
actionmuxer: Add a precondition

This helps with debugging the inspectors action
handling.

2 years agoUpdate Bulgarian translation
Alexander Shopov [Fri, 7 Apr 2023 16:26:55 +0000 (16:26 +0000)]
Update Bulgarian translation

(cherry picked from commit f15aa82eaf4a8d9498b53e3e416d2ac21d6b24f4)

2 years agoinspector: Be more careful
Matthias Clasen [Fri, 7 Apr 2023 13:16:21 +0000 (09:16 -0400)]
inspector: Be more careful

Tweak the variant-editor code to handle some
cases more explicitly.

2 years agoinspector: Plug a memory leak
Matthias Clasen [Fri, 7 Apr 2023 12:55:40 +0000 (08:55 -0400)]
inspector: Plug a memory leak

2 years agoinspector: Be safer when handling actions
Matthias Clasen [Fri, 7 Apr 2023 12:52:51 +0000 (08:52 -0400)]
inspector: Be safer when handling actions

Those query apis are serious about not ignoring
their return value, and may not set their our
arguments to anything if they return FALSE.

2 years agoactionmuxer: Make the compiler warn
Matthias Clasen [Fri, 7 Apr 2023 12:02:44 +0000 (08:02 -0400)]
actionmuxer: Make the compiler warn

Warn when the boolean return isn't used, since we
may not initialize the out arguments in the FALSE
case (see the previous commits).

2 years agotextview: Handle a return value
Matthias Clasen [Fri, 7 Apr 2023 11:56:16 +0000 (07:56 -0400)]
textview: Handle a return value

2 years agoMerge branch '5729_fix_inspector_crash' into 'main'
Matthias Clasen [Fri, 7 Apr 2023 12:01:22 +0000 (12:01 +0000)]
Merge branch '5729_fix_inspector_crash' into 'main'

inspector: fix crash caused by uninitialized GVariant

Closes #5729

See merge request GNOME/gtk!5799

2 years agoinspector: fix crash caused by uninitialized GVariant
Nelson Benítez León [Thu, 6 Apr 2023 22:45:59 +0000 (18:45 -0400)]
inspector: fix crash caused by uninitialized GVariant

we were not checking the return gboolean of
gtk_action_muxer_query_action() which was
returning FALSE for the crash case, meaning
it didn't set the passed in GVariant, but
we were still using it as it was non-null.

Fixes #5729

2 years agoMerge branch 'media-controls' into 'main'
Matthias Clasen [Thu, 6 Apr 2023 17:59:54 +0000 (17:59 +0000)]
Merge branch 'media-controls' into 'main'

mediacontrols: Add tooltip text to play button

See merge request GNOME/gtk!5794

2 years agoMerge branch 'alert_dialog_role_mapping_fix' into 'main'
Matthias Clasen [Thu, 6 Apr 2023 17:59:05 +0000 (17:59 +0000)]
Merge branch 'alert_dialog_role_mapping_fix' into 'main'

a11y: Map GTK_ACCESSIBLE_ROLE_ALERT_DIALOG to ATSPI_ROLE_ALERT

See merge request GNOME/gtk!5796

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Thu, 6 Apr 2023 15:06:26 +0000 (15:06 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

glarea: Fix property notification

See merge request GNOME/gtk!5797

2 years agoglarea: Fix property notification
Matthias Clasen [Thu, 6 Apr 2023 14:37:58 +0000 (10:37 -0400)]
glarea: Fix property notification

This was broken in 9c26262e3e083006.

2 years agomediacontrols: Add tooltip text to play button
Maximiliano Sandoval R [Thu, 6 Apr 2023 10:10:11 +0000 (12:10 +0200)]
mediacontrols: Add tooltip text to play button

This makes the button accessible.

2 years agoa11y: Map GTK_ACCESSIBLE_ROLE_ALERT_DIALOG to ATSPI_ROLE_ALERT
Lukáš Tyrychtr [Thu, 6 Apr 2023 11:55:16 +0000 (13:55 +0200)]
a11y: Map GTK_ACCESSIBLE_ROLE_ALERT_DIALOG to ATSPI_ROLE_ALERT

By doing this, alert dialogs will be read automatically, or at least
they should be, because a screen reader know that these are special.

2 years agoMerge branch 'wip/exalm/centerlayout-shrink' into 'main'
Matthias Clasen [Wed, 5 Apr 2023 22:23:19 +0000 (22:23 +0000)]
Merge branch 'wip/exalm/centerlayout-shrink' into 'main'

centerlayout/box: Add :shrink-center-last

See merge request GNOME/gtk!5790

2 years agoMerge branch 'wip/exalm/shortcuts' into 'main'
Matthias Clasen [Wed, 5 Apr 2023 22:05:33 +0000 (22:05 +0000)]
Merge branch 'wip/exalm/shortcuts' into 'main'

Add style classes to standard dialogs

See merge request GNOME/gtk!5791

2 years agopagesetupunixdialog: Add "pagesetup" style class
Alexander Mikhaylenko [Wed, 5 Apr 2023 20:11:48 +0000 (00:11 +0400)]
pagesetupunixdialog: Add "pagesetup" style class

2 years agofontchooserdialog: Add "fontchooser" style class
Alexander Mikhaylenko [Wed, 5 Apr 2023 20:11:31 +0000 (00:11 +0400)]
fontchooserdialog: Add "fontchooser" style class

2 years agofilechooserdialog: Add "filechooser" style class
Alexander Mikhaylenko [Wed, 5 Apr 2023 20:10:54 +0000 (00:10 +0400)]
filechooserdialog: Add "filechooser" style class

2 years agocolorchooserdialog: Add "colorchooser" style class
Alexander Mikhaylenko [Wed, 5 Apr 2023 20:10:36 +0000 (00:10 +0400)]
colorchooserdialog: Add "colorchooser" style class

2 years agoappchooserdialog: Add "appchooser" style class
Alexander Mikhaylenko [Wed, 5 Apr 2023 20:10:25 +0000 (00:10 +0400)]
appchooserdialog: Add "appchooser" style class

2 years agoshortcutswindow: Add "shortcuts" style class
Alexander Mikhaylenko [Wed, 5 Apr 2023 20:10:09 +0000 (00:10 +0400)]
shortcutswindow: Add "shortcuts" style class

2 years agocenterbox: Expose GtkCenterLayout:shrink-center-last
Alexander Mikhaylenko [Wed, 5 Apr 2023 12:05:03 +0000 (16:05 +0400)]
centerbox: Expose GtkCenterLayout:shrink-center-last

2 years agocenterlayout: Add :shrink-center-last
Alexander Mikhaylenko [Wed, 5 Apr 2023 12:03:48 +0000 (16:03 +0400)]
centerlayout: Add :shrink-center-last

Allow to prioritize start and end children and have them keep their natural
size instead of center child if possible.

See https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5552#note_1708864

2 years agoMerge branch 'ebassi/listbox-dispose' into 'main'
Matthias Clasen [Wed, 5 Apr 2023 02:35:20 +0000 (02:35 +0000)]
Merge branch 'ebassi/listbox-dispose' into 'main'

listbox: Unbind the model before removing children

See merge request GNOME/gtk!5789

2 years agolistbox: Unbind the model before removing children
Emmanuele Bassi [Tue, 4 Apr 2023 12:40:49 +0000 (13:40 +0100)]
listbox: Unbind the model before removing children

Calling gtk_list_box_remove_all() is a no-op with a bound model; after
the introduction of the remove_all() method in 49e56fc7, we were left
with row widgets after the dispose() call chained up.

We could restore the explicit unparenting inside dispose() instead of
calling remove_all(), but since the bound list model is provided by the
user of GtkListBox, it's more appropriate to unbind it in the dispose()
implementation, to avoid any potential reference cycle (especially in
higher level languages that have no explicit reference acquisition).

We clean up the bound model, and its associated state, if any; and then
we remove all the row widgets that are left.

2 years agoMerge branch 'glarea-allowed-apis' into 'main'
Matthias Clasen [Tue, 4 Apr 2023 03:14:21 +0000 (03:14 +0000)]
Merge branch 'glarea-allowed-apis' into 'main'

glarea: Add GtkGLArea::allowed-apis

Closes #5330

See merge request GNOME/gtk!5786

2 years agogtk-demo: Update the GLArea examples
Matthias Clasen [Mon, 3 Apr 2023 23:26:12 +0000 (19:26 -0400)]
gtk-demo: Update the GLArea examples

2 years agoglarea: Add GtkGLArea::allowed-apis
Matthias Clasen [Mon, 3 Apr 2023 23:24:58 +0000 (19:24 -0400)]
glarea: Add GtkGLArea::allowed-apis

Add api that mirrors the new GdkGLContext api
for selecting OpenGL variants, and deprecate
the old use_es api.

Fixes: #5330
2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Tue, 4 Apr 2023 02:50:08 +0000 (02:50 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

expander: Fix the css docs

Closes #5723

See merge request GNOME/gtk!5787

2 years agoMerge branch 'node-editor-things' into 'main'
Matthias Clasen [Tue, 4 Apr 2023 02:47:39 +0000 (02:47 +0000)]
Merge branch 'node-editor-things' into 'main'

Revert "rendernodepaintable: Provide accurate aspect ratio"

See merge request GNOME/gtk!5788

2 years agonode-editor: Improve the scaling
Matthias Clasen [Tue, 4 Apr 2023 02:32:31 +0000 (22:32 -0400)]
node-editor: Improve the scaling

We only want to scale the main rendering, not whats
shown in the sidebar. Also, make the scale logarithmic.

2 years agorendernodepaintable: Preserve aspect ratio in snapshot()
Matthias Clasen [Tue, 4 Apr 2023 02:19:39 +0000 (22:19 -0400)]
rendernodepaintable: Preserve aspect ratio in snapshot()

This is the better fix.

2 years agoRevert "rendernodepaintable: Provide accurate aspect ratio"
Matthias Clasen [Tue, 4 Apr 2023 02:16:43 +0000 (22:16 -0400)]
Revert "rendernodepaintable: Provide accurate aspect ratio"

This reverts commit 52a849288793e7eede878798a88760c058266f60.

It turned out to be the wrong fix.

2 years agoexpander: Fix the css docs
Matthias Clasen [Mon, 3 Apr 2023 23:33:31 +0000 (19:33 -0400)]
expander: Fix the css docs

The docs were not matching reality since the
css node names were changed in 6d20fe0b.

Fixes: #5723
2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Mon, 3 Apr 2023 18:14:51 +0000 (18:14 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

rendernode: Remove instance_init() function

See merge request GNOME/gtk!5785

2 years agoMerge branch 'bilelmoussaoui/return-fix' into 'main'
Matthias Clasen [Mon, 3 Apr 2023 18:04:08 +0000 (18:04 +0000)]
Merge branch 'bilelmoussaoui/return-fix' into 'main'

gtk: Fix *_get_tab_behaviour return type

See merge request GNOME/gtk!5784

2 years agorendernode: Cosmetics
Benjamin Otte [Mon, 3 Apr 2023 14:44:03 +0000 (16:44 +0200)]
rendernode: Cosmetics

Simplify a function.

2 years agorendernode: Get rid of GskRenderNodeTypeInfo
Benjamin Otte [Mon, 3 Apr 2023 14:39:52 +0000 (16:39 +0200)]
rendernode: Get rid of GskRenderNodeTypeInfo

Instead, use class_init functions.

2 years agorendernode: Remove instance_init() function
Benjamin Otte [Mon, 3 Apr 2023 13:00:29 +0000 (15:00 +0200)]
rendernode: Remove instance_init() function

It's not used.

2 years agogtk: Fix *_get_tab_behaviour return type
Bilal Elmoussaoui [Mon, 3 Apr 2023 16:55:04 +0000 (18:55 +0200)]
gtk: Fix *_get_tab_behaviour return type

2 years agoPost-release version bump
Matthias Clasen [Mon, 3 Apr 2023 14:54:11 +0000 (10:54 -0400)]
Post-release version bump

2 years ago4.11.1
Matthias Clasen [Mon, 3 Apr 2023 14:40:16 +0000 (10:40 -0400)]
4.11.1

2 years agoNEWS: Updates
Matthias Clasen [Mon, 3 Apr 2023 14:36:40 +0000 (10:36 -0400)]
NEWS: Updates

2 years agoAdd comment on versions
Matthias Clasen [Mon, 3 Apr 2023 10:50:52 +0000 (06:50 -0400)]
Add comment on versions

Some versions are specfied in multiple places.
Add a reminder to update all places.

2 years agoMerge branch 'gbsneto/vulkan-layout-fixes' into 'main'
Benjamin Otte [Mon, 3 Apr 2023 14:27:24 +0000 (14:27 +0000)]
Merge branch 'gbsneto/vulkan-layout-fixes' into 'main'

Vulkan fractional scale support, image layout and clip region fixes, cleanups

See merge request GNOME/gtk!5783

2 years agovulkan: Support fractional scaling
Georges Basile Stavracas Neto [Mon, 3 Apr 2023 13:39:25 +0000 (10:39 -0300)]
vulkan: Support fractional scaling

Basically what GL does, but without any debug or feature flag
to gatekeep it, since the Vulkan backend itself is experimental
already.

Ceil surface sizes, and floor coordinates, to the fractional scale
value.

2 years agogsk/vulkan/renderpass: Don't scale scissor and render area
Georges Basile Stavracas Neto [Mon, 3 Apr 2023 13:06:18 +0000 (10:06 -0300)]
gsk/vulkan/renderpass: Don't scale scissor and render area

The rects passed to the clip region are in buffer coordinates, and
must not be scaled. Consider the following scenario: Wayland, with
a 1024x768@2 window. That gives us a 2048x1536 raw image. To setup
the Vulkan render pass code, we'd scale 2048x1536 *again*, to an
unreasonable 4196x3072, which is (1) incorrect and (2) really
incorrect and (3) can lead to crashes at best, full GPU resets
at worst - and a GPU reset is incredibly not fun!

Now that we pass the right clip regions at the right coordinates
at all times, remove the extra scaling from the render pass.

2 years agogsk/vulkan: Cosmetics
Georges Basile Stavracas Neto [Mon, 3 Apr 2023 11:54:34 +0000 (08:54 -0300)]
gsk/vulkan: Cosmetics

No functional changes. Use a variable that already exists instead
of calling gdk_draw_context_get_surface() again. Cleanup some
newlines.

2 years agogsk/vulkan/renderer: Pass appropriate clip region
Georges Basile Stavracas Neto [Sun, 2 Apr 2023 22:18:24 +0000 (19:18 -0300)]
gsk/vulkan/renderer: Pass appropriate clip region

This part of the Vulkan renderer is almost exactly equal to the GL
renderer, and the GL renderer already does that since at least
2a38cecd3351. Copy that into the Vulkan renderer.

A nice side effect from this commit is that resizing a window now
actually works again.

Sneak in a trivial cleanup by using a variable to hold the draw
index.

2 years agogsk/vulkan/buffer: Pass aligned memory value
Georges Basile Stavracas Neto [Sun, 2 Apr 2023 21:23:21 +0000 (18:23 -0300)]
gsk/vulkan/buffer: Pass aligned memory value

This was a tricky one to figure out, but it's pretty simple to
understand (I hope!).

So, this AMD card I'm using requires buffer memory sizes to be
aligned to 16 bytes. Intel is aligned to 4 bytes I think, but
AMD - or at least this AMD model in particular - uses 16 bytes
for alignment.

When creating a a particular texture (I did not determin which one
specifically!) a buffer of size 1276 bytes is requested.

1276 / 16 = 79.75, which is clearly not aligned to the required
16 bytes.

We request Vulkan to create a buffer of 1276 bytes for us, it
figures out that it's not aligned, and creates a buffer of 1280
bytes, which is aligned. The extra 4 bytes are wasted, but that's
okay. We immediately query this buffer for this exact information,
using vkGetBufferMemoryRequirements(), and proceed to create actual
memory to back this buffer up.

The buffer tells us we must use 1280 bytes, so we pass 1280 bytes
and everyone is happy, right? Of course not. We pass 1276 bytes,
and Vulkan is subtly unhappy at us.

Fix that by passing the value that Vulkan asks us to use, i.e.,
the size returned by vkGetBufferMemoryRequirements().

2 years agogsk/vulkan/glyphcache: Ceil glyph surface size
Georges Basile Stavracas Neto [Sat, 1 Apr 2023 19:09:06 +0000 (16:09 -0300)]
gsk/vulkan/glyphcache: Ceil glyph surface size

This is what GL does, and for a reason: it can lead to width or
height for very small glyphs. Also, switch to dividing by a float
(1024.0) instead of an integer (1024).

2 years agogsk/vulkanimage: Set buffer row length and height
Georges Basile Stavracas Neto [Thu, 23 Mar 2023 02:01:10 +0000 (23:01 -0300)]
gsk/vulkanimage: Set buffer row length and height

This doesn't make any difference now, but will allow us to copy
subregions more easily. This is not obvious, but here's a quick
explanation:

Leaving 'bufferRowLength' and 'bufferImageHeight' implies that
Vulkan will assume the size passed in the 'imageExtent' field.
Right now, this assumption is correct - the only user of this
function is the glyph cache, and it only copies and uploads
exact rects. Next commits will change that assumption, so we
must pass 'buffer*' fields, and tell Vulkan, "this part of the
buffer represents an image of width x height, and I want the
subregion (x, y, smallerWidth, smallerHeight) of this image".

2 years agogsk/vulkan/image: Use UNDEFINED for initial layout
Georges Basile Stavracas Neto [Sat, 1 Apr 2023 18:33:10 +0000 (15:33 -0300)]
gsk/vulkan/image: Use UNDEFINED for initial layout

When creating an image using gsk_vulkan_image_new_for_framebuffer(),
it passes VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL.

However, this is a mistake. The spec demands that the initial
layout must be either VK_IMAGE_LAYOUT_UNDEFINED or
VK_IMAGE_LAYOUT_PREINITIALIZED.

Apparently this was an oversight from commit b97fb751469, since the
commit message even documents that, and all other calls pass either
VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED.

Create framebuffer images using VK_IMAGE_LAYOUT_UNDEFINED, which is
what was originally expected.

2 years agoMerge branch 'listbox-remove-all' into 'main'
Matthias Clasen [Mon, 3 Apr 2023 10:29:13 +0000 (10:29 +0000)]
Merge branch 'listbox-remove-all' into 'main'

gtklistbox: Add remove_all()

See merge request GNOME/gtk!5779

2 years agoMerge branch 'zbrown/bump-protocols' into 'main'
Matthias Clasen [Mon, 3 Apr 2023 10:28:44 +0000 (10:28 +0000)]
Merge branch 'zbrown/bump-protocols' into 'main'

build: We need wayland-protocols 1.31

See merge request GNOME/gtk!5780

2 years agoUpdate Russian translation
Aleksandr Melman [Mon, 3 Apr 2023 07:29:46 +0000 (07:29 +0000)]
Update Russian translation

2 years agobuild: We need wayland-protocols 1.31
Zander Brown [Mon, 3 Apr 2023 01:12:54 +0000 (01:12 +0000)]
build: We need wayland-protocols 1.31

https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5767

2 years agogtkflowbox: Add remove_all()
Christopher Davis [Wed, 29 Sep 2021 22:20:37 +0000 (15:20 -0700)]
gtkflowbox: Add remove_all()

Removing all items from containers is a common use case.
Without this applications needed to implement this manually.
It makes senses to handle it here.

2 years agogtklistbox: Add remove_all()
Christopher Davis [Wed, 29 Sep 2021 21:26:49 +0000 (14:26 -0700)]
gtklistbox: Add remove_all()

Adds a function to remove all children from
a GtkListBox. This way app developers don't need to
implement this themselves.

2 years agogsk/vulkan/image: Cosmetics
Georges Basile Stavracas Neto [Sat, 1 Apr 2023 18:27:43 +0000 (15:27 -0300)]
gsk/vulkan/image: Cosmetics

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Sun, 2 Apr 2023 19:14:05 +0000 (19:14 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

tooltipwindow: Cast the correct object

See merge request GNOME/gtk!5774

2 years agoMerge branch 'docs-updates' into 'main'
Matthias Clasen [Sun, 2 Apr 2023 18:43:55 +0000 (18:43 +0000)]
Merge branch 'docs-updates' into 'main'

docs: Document new environment variables

See merge request GNOME/gtk!5777

2 years agotooltipwindow: Cast the correct object
Benjamin Otte [Sun, 2 Apr 2023 12:06:11 +0000 (14:06 +0200)]
tooltipwindow: Cast the correct object

the tooltipwindow is in the userdata.

2 years agoMerge branch 'scale-factor-cleanup' into 'main'
Matthias Clasen [Sun, 2 Apr 2023 18:09:26 +0000 (18:09 +0000)]
Merge branch 'scale-factor-cleanup' into 'main'

wayland: Be more careful about scale-factor

See merge request GNOME/gtk!5775