Skip to content

Commit

Permalink
EdgeScroll: implement per monitor
Browse files Browse the repository at this point in the history
Bring the EdgeScroll command inline with other command, such as
EwmhBaseStruts whereby the dimensions can be specified per-monitor, such
as:

    EdgeScroll 0 0
    EdgeScroll screen DP-1 100 100
  • Loading branch information
ThomasAdam committed Oct 20, 2023
1 parent c30f8b1 commit f59847f
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions fvwm/virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -2140,8 +2140,22 @@ void CMD_EdgeThickness(F_CMD_ARGS)
void CMD_EdgeScroll(F_CMD_ARGS)
{
int val1, val2, val1_unit, val2_unit, n;
char *token;
struct monitor *m;
char *token, *option;
struct monitor *m = NULL, *m_this = NULL;

option = PeekToken(action, NULL);
if (StrEquals(option, "screen")) {
/* Skip literal 'screen' */
option = PeekToken(action, &action);
/* Actually get the screen value. */
option = PeekToken(action, &action);

if ((m = monitor_resolve_name(option)) == NULL) {
fvwm_debug(__func__, "Invalid screen: %s", option);
return;
}
}


n = GetTwoArguments(action, &val1, &val2, &val1_unit, &val2_unit);
if (n != 2)
Expand Down Expand Up @@ -2194,10 +2208,20 @@ void CMD_EdgeScroll(F_CMD_ARGS)
}
}

TAILQ_FOREACH(m, &monitor_q, entry) {
if (m != NULL) {
m->virtual_scr.EdgeScrollX = val1 * val1_unit / 100;
m->virtual_scr.EdgeScrollY = val2 * val2_unit / 100;
checkPanFrames(m);

return;
}

TAILQ_FOREACH(m_this, &monitor_q, entry) {
if (m != NULL && m == m_this)
continue;
m_this->virtual_scr.EdgeScrollX = val1 * val1_unit / 100;
m_this->virtual_scr.EdgeScrollY = val2 * val2_unit / 100;
checkPanFrames(m_this);
}


Expand Down

0 comments on commit f59847f

Please sign in to comment.