mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 21:21:21 +00:00
sizerequestcache: Increase size
This is a quickfix to avoid infinite runtime in nested boxes with wrapped labels. Test included
This commit is contained in:
parent
de3c50a237
commit
a0ca936e8d
@ -36,7 +36,7 @@ G_BEGIN_DECLS
|
|||||||
* only wrap to 3 lines, only 3 caches will
|
* only wrap to 3 lines, only 3 caches will
|
||||||
* ever be allocated for it.
|
* ever be allocated for it.
|
||||||
*/
|
*/
|
||||||
#define GTK_SIZE_REQUEST_CACHED_SIZES (5)
|
#define GTK_SIZE_REQUEST_CACHED_SIZES (64)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int minimum_size;
|
int minimum_size;
|
||||||
@ -74,8 +74,8 @@ typedef struct {
|
|||||||
GtkSizeRequestMode request_mode : 3;
|
GtkSizeRequestMode request_mode : 3;
|
||||||
guint request_mode_valid : 1;
|
guint request_mode_valid : 1;
|
||||||
struct {
|
struct {
|
||||||
guint n_cached_requests : 3;
|
guint n_cached_requests : 15;
|
||||||
guint last_cached_request : 3;
|
guint last_cached_request : 15;
|
||||||
guint cached_size_valid : 1;
|
guint cached_size_valid : 1;
|
||||||
} flags[2];
|
} flags[2];
|
||||||
} SizeRequestCache;
|
} SizeRequestCache;
|
||||||
|
@ -529,6 +529,8 @@ testdata = [
|
|||||||
#'window-show-contents-on-map.ui',
|
#'window-show-contents-on-map.ui',
|
||||||
'wrap-margin-align-critical.ref.ui',
|
'wrap-margin-align-critical.ref.ui',
|
||||||
'wrap-margin-align-critical.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.
|
# These need to be fixed but the issue hasn't been tracked down.
|
||||||
|
22
testsuite/reftests/wrapping-in-boxes-in-boxes.ref.ui
Normal file
22
testsuite/reftests/wrapping-in-boxes-in-boxes.ref.ui
Normal file
@ -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>
|
58
testsuite/reftests/wrapping-in-boxes-in-boxes.ui
Normal file
58
testsuite/reftests/wrapping-in-boxes-in-boxes.ui
Normal file
@ -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>
|
Loading…
Reference in New Issue
Block a user