Skip to content
Snippets Groups Projects
Commit d58c1bba authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Refine last commit...

Add a comment explaining why we do what we do, and verify the aspect
is unchanged as well since we could change only the aspect and need
to set new hints in some cases.
parent 56c269ff
Branches
Tags
No related merge requests found
Pipeline #6729 canceled
......@@ -786,6 +786,8 @@ map_window(bool mp)
static last_minh = 0;
static last_maxw = 0;
static last_maxh = 0;
static last_aspectx = 0;
static last_aspecty = 0;
bool extents_changed = false;
sh = x11.XAllocSizeHints();
......@@ -841,9 +843,23 @@ map_window(bool mp)
sh->min_aspect.x = sh->max_aspect.x = sh->min_width;
sh->min_aspect.y = sh->max_aspect.y = sh->min_height;
}
if (sh->min_aspect.x != last_aspectx)
extents_changed = true;
last_aspectx = sh->min_aspect.x;
if (sh->min_aspect.y != last_aspecty)
extents_changed = true;
last_aspecty = sh->min_aspect.y;
sh->flags |= PAspect;
/*
* It appears that herbstluftwm will give focus to anything calling
* XSetWMNormalHints(), so be careful to not do it in response to
* a _NET_FRAME_EXTENTS change since we get that when we're losing
* focus due to focus follows mouse, which results in SyncTERM and
* herbstluftwm fighting over if SyncTERM is focused or not
* (SyncTERM wins).
*/
if (extents_changed || mp)
x11.XSetWMNormalHints(dpy, win, sh);
pthread_mutex_lock(&vstatlock);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment