diff options
author | Benjamin Otte <otte@redhat.com> | 2021-11-19 23:22:39 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2021-11-20 06:04:10 +0100 |
commit | a0ca936e8d42daf49111a59d2482b53ae16001c9 (patch) | |
tree | 9a162acb63245467de73ead8ffb03ffa5218c60b | |
parent | de3c50a2373e906536e6ed59d69769eec4ca8c9e (diff) | |
download | gtk+-a0ca936e8d42daf49111a59d2482b53ae16001c9.tar.gz |
sizerequestcache: Increase size
This is a quickfix to avoid infinite runtime in nested boxes with
wrapped labels.
Test included
-rw-r--r-- | gtk/gtksizerequestcacheprivate.h | 6 | ||||
-rw-r--r-- | testsuite/reftests/meson.build | 2 | ||||
-rw-r--r-- | testsuite/reftests/wrapping-in-boxes-in-boxes.ref.ui | 22 | ||||
-rw-r--r-- | testsuite/reftests/wrapping-in-boxes-in-boxes.ui | 58 |
4 files changed, 85 insertions, 3 deletions
diff --git a/gtk/gtksizerequestcacheprivate.h b/gtk/gtksizerequestcacheprivate.h index 5d460ed013..8b3a3b7240 100644 --- a/gtk/gtksizerequestcacheprivate.h +++ b/gtk/gtksizerequestcacheprivate.h @@ -36,7 +36,7 @@ G_BEGIN_DECLS * only wrap to 3 lines, only 3 caches will * ever be allocated for it. */ -#define GTK_SIZE_REQUEST_CACHED_SIZES (5) +#define GTK_SIZE_REQUEST_CACHED_SIZES (64) typedef struct { int minimum_size; @@ -74,8 +74,8 @@ typedef struct { GtkSizeRequestMode request_mode : 3; guint request_mode_valid : 1; struct { - guint n_cached_requests : 3; - guint last_cached_request : 3; + guint n_cached_requests : 15; + guint last_cached_request : 15; guint cached_size_valid : 1; } flags[2]; } SizeRequestCache; diff --git a/testsuite/reftests/meson.build b/testsuite/reftests/meson.build index 01f813bee5..1df038aa22 100644 --- a/testsuite/reftests/meson.build +++ b/testsuite/reftests/meson.build @@ -529,6 +529,8 @@ testdata = [ #'window-show-contents-on-map.ui', 'wrap-margin-align-critical.ref.ui', 'wrap-margin-align-critical.ui', + 'wrapping-in-boxes-in-boxes.ref.ui', + 'wrapping-in-boxes-in-boxes.ui', ] # These need to be fixed but the issue hasn't been tracked down. diff --git a/testsuite/reftests/wrapping-in-boxes-in-boxes.ref.ui b/testsuite/reftests/wrapping-in-boxes-in-boxes.ref.ui new file mode 100644 index 0000000000..db2293bd30 --- /dev/null +++ b/testsuite/reftests/wrapping-in-boxes-in-boxes.ref.ui @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <object class="GtkWindow" id="window1"> + <property name="decorated">0</property> + <child> + <object class="GtkBox"> + <child> + <object class="GtkBox"> + <property name="orientation">vertical</property> + <child> + <object class="GtkLabel"> + <property name="label" translatable="yes">Lorem ipsum dolor sit amet, consectetur adipisci elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</property> + <property name="wrap">1</property> + <property name="max-width-chars">60</property> + </object> + </child> + </object> + </child> + </object> + </child> + </object> +</interface> diff --git a/testsuite/reftests/wrapping-in-boxes-in-boxes.ui b/testsuite/reftests/wrapping-in-boxes-in-boxes.ui new file mode 100644 index 0000000000..6de4a24ef4 --- /dev/null +++ b/testsuite/reftests/wrapping-in-boxes-in-boxes.ui @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <object class="GtkWindow" id="window1"> + <property name="decorated">0</property> + <child> + <object class="GtkBox"> + <child> + <object class="GtkBox"> + <property name="orientation">vertical</property> + <child> + <object class="GtkBox"> + <child> + <object class="GtkBox"> + <property name="orientation">vertical</property> + <child> + <object class="GtkBox"> + <child> + <object class="GtkBox"> + <property name="orientation">vertical</property> + <child> + <object class="GtkBox"> + <child> + <object class="GtkBox"> + <property name="orientation">vertical</property> + <child> + <object class="GtkBox"> + <child> + <object class="GtkBox"> + <property name="orientation">vertical</property> + <child> + <object class="GtkLabel"> + <property name="label" translatable="yes">Lorem ipsum dolor sit amet, consectetur adipisci elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</property> + <property name="wrap">1</property> + <property name="max-width-chars">60</property> + </object> + </child> + </object> + </child> + </object> + </child> + </object> + </child> + </object> + </child> + </object> + </child> + </object> + </child> + </object> + </child> + </object> + </child> + </object> + </child> + </object> + </child> + </object> +</interface> |