Repeatedly maximizing the window or resizing the window may cause the application to hang.
I'm currently porting my app Pods
to libadwaita 1.4 and noticed a strange issue where the application gets slower and slower the more I maximize the application window or shrink its width in order to show/hide the sidebar.
I wasn't sure at first if it was a Rust-specific problem. So I tried to create a minimal widget tree, which I naively added here in adw-demo-window.ui
using the latest version from git.
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<requires lib="libadwaita" version="1.0"/>
<menu id="primary_menu">
<section>
<item>
<attribute name="label" translatable="yes">_Inspector</attribute>
<attribute name="action">app.inspector</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Preferences</attribute>
<attribute name="action">app.preferences</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_About Adwaita Demo</attribute>
<attribute name="action">app.about</attribute>
</item>
</section>
</menu>
<template class="AdwDemoWindow" parent="AdwApplicationWindow">
<property name="height-request">180</property>
<property name="width-request">360</property>
<property name="content">
<object class="GtkStack">
<child>
<object class="GtkStackPage">
<property name="name">client</property>
<property name="child">
<object class="AdwBreakpointBin">
<property name="height-request">180</property>
<property name="width-request">360</property>
<child>
<object class="AdwBreakpoint">
<condition>min-width: 600sp</condition>
<setter object="navigation_split_view" property="collapsed">False</setter>
</object>
</child>
<child>
<object class="AdwNavigationSplitView" id="navigation_split_view">
<property name="collapsed">True</property>
<property name="min-sidebar-width">240</property>
<property name="max-sidebar-width" translatable="yes">280</property>
<property name="sidebar-width-unit">sp</property>
<property name="sidebar-width-fraction">0.4</property>
<property name="vexpand">True</property>
<property name="sidebar">
<object class="AdwNavigationPage">
<property name="title" translatable="yes">Home</property>
<property name="child">
<object class="AdwNavigationView" id="sidebar_navigation_view">
<property name="animate-transitions" bind-source="navigation_split_view" bind-property="collapsed" bind-flags="sync-create"/>
<child>
<object class="AdwNavigationPage">
<property name="tag">home</property>
<property name="title" translatable="yes">Home</property>
<child>
<object class="AdwToolbarView">
<child type="top">
<object class="AdwHeaderBar"/>
</child>
</object>
</child>
</object>
</child>
</object>
</property>
</object>
</property>
<property name="content">
<object class="AdwNavigationPage">
<property name="child">
<object class="AdwNavigationView">
<child>
<object class="AdwNavigationPage">
<child>
<object class="GtkStack">
<property name="vexpand">True</property>
<child>
<object class="GtkStackPage">
<property name="child">
<object class="GtkStack">
<child>
<object class="GtkStackPage">
<property name="child">
<object class="AdwToolbarView">
<child type="top">
<object class="AdwHeaderBar"/>
</child>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="child">
<object class="AdwToolbarView">
<child type="top">
<object class="AdwHeaderBar"/>
</child>
<child type="top">
<object class="AdwHeaderBar" id="selection_header_bar">
<child type="start">
<object class="GtkButton">
<property name="action-name">containers-panel.exit-selection-mode</property>
<property name="label" translatable="yes">Cancel</property>
</object>
</child>
<child type="title">
<object class="GtkMenuButton" id="selected_containers_button">
<style>
<class name="flat"/>
</style>
<property name="can-shrink">True</property>
</object>
</child>
</object>
</child>
<child type="top">
<object class="GtkSearchBar">
<child>
<object class="GtkSearchEntry">
<property name="max-width-chars">28</property>
</object>
</child>
</object>
</child>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">empty</property>
<property name="child">
<object class="AdwToolbarView">
<child type="top">
<object class="AdwHeaderBar"/>
</child>
</object>
</property>
</object>
</child>
</object>
</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</property>
</object>
</property>
</object>
</child>
</object>
</property>
</object>
</child>
</object>
</property>
</template>
</interface>
I recorded a video that illustrates the problem: the longer I resize/maximize the window, the more the application hangs. This is most clearly visible towards the end of the video.