You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have two displays, one positioned lower than the other. To make swapping between the two monitors flawless, I configured them with the following xrandr command:
This configuration adds a 300-pixel vertical offset for the second monitor. While the bar is correctly positioned, windows on the second monitor are not respecting the offset and are shifted up by 300 px exceeding the screen size.
After inspecting dwm.c, I found that the arrangemon function had an incorrect wy value for the second monitor. To address this, I implemented a quick fix that excludes the monocle layout (as full-sized windows work correctly) and temporarily adjusts m->wy during the arrangement process.
Temporary Fix
Here’s my updated arrangemon function:
voidarrangemon(Monitor*m) {
updatebarpos(m);
updatesystray();
XMoveResizeWindow(dpy, m->tabwin, m->wx+m->gappov, m->ty, m->ww-2*m->gappov, th);
XMoveWindow(dpy, m->tagwin, m->wx+m->gappov, m->by+ (m->topbar ? (bh+m->gappoh) : (- (m->mh / scalepreview) -m->gappoh)));
strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeofm->ltsymbol);
if (m->mh==1080&&m->lt[m->sellt]->arrange!=monocle) {
m->wy-=300;
}
if (m->lt[m->sellt]->arrange) {
m->lt[m->sellt]->arrange(m);
}
// Restore wy to its original value after arrangementif (m->mh==1080&&m->lt[m->sellt]->arrange!=monocle) {
m->wy+=300;
}
}
I suspect the root cause lies in how the Monitor struct (m) is handled, as the values appear correct in updategeom.
I don’t really have the time or the technical knowledge to implement a proper fix myself, so I’m sharing this quick fix as an example in case someone else encounters the same problem. Hopefully, this can serve as a starting point for a more robust solution.
The text was updated successfully, but these errors were encountered:
I have two displays, one positioned lower than the other. To make swapping between the two monitors flawless, I configured them with the following
xrandr
command:This configuration adds a 300-pixel vertical offset for the second monitor. While the bar is correctly positioned, windows on the second monitor are not respecting the offset and are shifted up by 300 px exceeding the screen size.
After inspecting
dwm.c
, I found that thearrangemon
function had an incorrectwy
value for the second monitor. To address this, I implemented a quick fix that excludes the monocle layout (as full-sized windows work correctly) and temporarily adjustsm->wy
during the arrangement process.Temporary Fix
Here’s my updated
arrangemon
function:I suspect the root cause lies in how the
Monitor
struct (m
) is handled, as the values appear correct inupdategeom
.I don’t really have the time or the technical knowledge to implement a proper fix myself, so I’m sharing this quick fix as an example in case someone else encounters the same problem. Hopefully, this can serve as a starting point for a more robust solution.
The text was updated successfully, but these errors were encountered: