diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2022-10-02 22:35:01 +0300 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2022-10-03 12:04:20 +0300 |
commit | 3396ec611e48b0a1063ce07cf05247424564693d (patch) | |
tree | b282f596420540399892113cd1434efadfe66669 /src/core | |
parent | dc4f38fcea194897ac49dc93b24607498dc01ea6 (diff) | |
download | metacity-3396ec611e48b0a1063ce07cf05247424564693d.tar.gz |
xprops: simplify size_hints_from_results
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/window-props.c | 9 | ||||
-rw-r--r-- | src/core/xprops.c | 19 |
2 files changed, 9 insertions, 19 deletions
diff --git a/src/core/window-props.c b/src/core/window-props.c index 0b42e569..fcd1e90e 100644 --- a/src/core/window-props.c +++ b/src/core/window-props.c @@ -1163,13 +1163,6 @@ meta_set_normal_hints (MetaWindow *window, w = window->size_hints.width; h = window->size_hints.height; - /* as far as I can tell, value->v.size_hints.flags is just to - * check whether we had old-style normal hints without gravity, - * base size as returned by XGetNormalHints(), so we don't - * really use it as we fixup window->size_hints to have those - * fields if they're missing. - */ - /* * When the window is first created, NULL hints will * be passed in which will initialize all of the fields @@ -1499,7 +1492,7 @@ reload_normal_hints (MetaWindow *window, old_hints = window->size_hints; - meta_set_normal_hints (window, value->v.size_hints.hints); + meta_set_normal_hints (window, value->v.size_hints); spew_size_hints_differences (&old_hints, &window->size_hints); diff --git a/src/core/xprops.c b/src/core/xprops.c index 12a24d4d..1e325f2c 100644 --- a/src/core/xprops.c +++ b/src/core/xprops.c @@ -796,15 +796,14 @@ class_hint_from_results (GetPropertyResults *results, } static gboolean -size_hints_from_results (GetPropertyResults *results, - XSizeHints **hints_p, - gulong *flags_p) +size_hints_from_results (GetPropertyResults *results, + XSizeHints **hints_p) { xPropSizeHints *raw; XSizeHints *hints; + gulong flags; *hints_p = NULL; - *flags_p = 0; if (!validate_or_free_results (results, 32, XA_WM_SIZE_HINTS, FALSE)) return FALSE; @@ -833,16 +832,16 @@ size_hints_from_results (GetPropertyResults *results, hints->max_aspect.x = cvtINT32toInt (raw->maxAspectX); hints->max_aspect.y = cvtINT32toInt (raw->maxAspectY); - *flags_p = (USPosition | USSize | PAllHints); + flags = (USPosition | USSize | PAllHints); if (results->n_items >= NumPropSizeElements) { hints->base_width= cvtINT32toInt (raw->baseWidth); hints->base_height= cvtINT32toInt (raw->baseHeight); hints->win_gravity= cvtINT32toInt (raw->winGravity); - *flags_p |= (PBaseSize | PWinGravity); + flags |= (PBaseSize | PWinGravity); } - hints->flags &= (*flags_p); /* get rid of unwanted bits */ + hints->flags &= flags; /* get rid of unwanted bits */ XFree (results->prop); results->prop = NULL; @@ -1098,9 +1097,7 @@ meta_prop_get_values (MetaDisplay *display, values[i].type = META_PROP_VALUE_INVALID; break; case META_PROP_VALUE_SIZE_HINTS: - if (!size_hints_from_results (&results, - &values[i].v.size_hints.hints, - &values[i].v.size_hints.flags)) + if (!size_hints_from_results (&results, &values[i].v.size_hints)) values[i].type = META_PROP_VALUE_INVALID; break; case META_PROP_VALUE_SYNC_COUNTER: @@ -1158,7 +1155,7 @@ free_value (MetaPropValue *value) meta_XFree (value->v.class_hint.res_name); break; case META_PROP_VALUE_SIZE_HINTS: - meta_XFree (value->v.size_hints.hints); + meta_XFree (value->v.size_hints); break; case META_PROP_VALUE_UTF8_LIST: g_strfreev (value->v.string_list.strings); |