Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ta/from dv #629

Merged
merged 4 commits into from
Nov 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/fvwm3/fvwm3.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3094,6 +3094,8 @@ AddToMenu RootMenu
turn the option on or off, or "toggle" to switch is back and forth. If
_bool_ is omitted, the default setting is restored.
+
_DebugRandR_ activates monitor layout debug messages.
+
_FlickeringMoveWorkaround_ disables ConfigureNotify events that are
usually sent to an application while it is moved. If some windows
flicker annoyingly while being moved, this option may help you. Note
Expand Down
5 changes: 4 additions & 1 deletion fvwm/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -3850,7 +3850,10 @@ void CMD_BugOpts(F_CMD_ARGS)
Scr.bo.do_debug_randr = 0;
break;
}
monitor_dump_state(NULL);
if (Scr.bo.do_debug_randr)
{
monitor_dump_state(NULL);
}
}
else if (StrEquals(opt, "TransliterateUtf8"))
{
Expand Down
2 changes: 1 addition & 1 deletion fvwm/conditional.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ void CreateConditionMask(char *flags, WindowConditionMask *mask)
if (tmp && *tmp)
{
fvwm_debug( __func__,
"Use comma instead of whiespace to separate "
"Use comma instead of whitespace to separate "
"conditions");
} else {
if (allocated_condition != NULL)
Expand Down
5 changes: 4 additions & 1 deletion fvwm/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -1770,7 +1770,10 @@ void monitor_update_ewmh(void)
struct monitor *m, *mref;

fvwm_debug(__func__, "monitor debug...\n");
monitor_dump_state(NULL);
if (Scr.bo.do_debug_randr)
{
monitor_dump_state(NULL);
}

mref = TAILQ_FIRST(&monitor_q);

Expand Down
37 changes: 27 additions & 10 deletions fvwm/ewmh.c
Original file line number Diff line number Diff line change
Expand Up @@ -983,9 +983,13 @@ void ewmh_ComputeAndSetWorkArea(struct monitor *m)
width = m->si->w - (left + right);
height = m->si->h - (top + bottom);

fvwm_debug(__func__, "monitor '%s': {l: %d, r: %d, t: %d, b: %d} "
"{x: %d, y: %d, w: %d, h: %d}\n", m->si->name,
left, right, top, bottom, x, y, width, height);
if (Scr.bo.do_debug_randr)
{
fvwm_debug(
__func__, "monitor '%s': {l: %d, r: %d, t: %d, b: %d} "
"{x: %d, y: %d, w: %d, h: %d}\n", m->si->name,
left, right, top, bottom, x, y, width, height);
}

if (
m->Desktops->ewmh_working_area.x != x ||
Expand All @@ -998,7 +1002,10 @@ void ewmh_ComputeAndSetWorkArea(struct monitor *m)
m->Desktops->ewmh_working_area.width = width;
m->Desktops->ewmh_working_area.height = height;

fvwm_debug(__func__, "differ, so setting work area\n");
if (Scr.bo.do_debug_randr)
{
fvwm_debug(__func__, "differ, so setting work area\n");
}

ewmh_SetWorkArea(m);
}
Expand Down Expand Up @@ -1075,10 +1082,15 @@ void EWMH_GetWorkAreaIntersection(
int area_h = m->Desktops->ewmh_working_area.height;
Bool is_dynamic = False;

fvwm_debug(__func__, "mon: %s {ax: %d, ay: %d, aw: %d, ah: %d\n",
m->si->name, area_x, area_y, area_w, area_h);
fvwm_debug(__func__, "mon: %s {x: %d, y: %d, w: %d, h: %d\n",
m->si->name, *x, *y, *w, *h);
if (Scr.bo.do_debug_randr)
{
fvwm_debug(
__func__, "mon: %s {ax: %d, ay: %d, aw: %d, ah: %d\n",
m->si->name, area_x, area_y, area_w, area_h);
fvwm_debug(
__func__, "mon: %s {x: %d, y: %d, w: %d, h: %d\n",
m->si->name, *x, *y, *w, *h);
}

/* FIXME: needs broadcast if global monitor in use. */

Expand Down Expand Up @@ -1111,8 +1123,13 @@ void EWMH_GetWorkAreaIntersection(
*w = nw;
*h = nh;

fvwm_debug(__func__, "mon: %s finalising: {x: %d, y: %d, w: %d, h: %d}\n",
m->si->name, *x, *y, *w, *h);
if (Scr.bo.do_debug_randr)
{
fvwm_debug(
__func__,
"mon: %s finalising: {x: %d, y: %d, w: %d, h: %d}\n",
m->si->name, *x, *y, *w, *h);
}

return;
}
Expand Down
5 changes: 4 additions & 1 deletion fvwm/focus.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,10 @@ static void __activate_window_by_command(
}

m = fw->m;
monitor_dump_state(m);
if (Scr.bo.do_debug_randr)
{
monitor_dump_state(m);
}
do_not_warp = StrEquals(PeekToken(action, NULL), "NoWarp");
if (!do_not_warp)
{
Expand Down
85 changes: 47 additions & 38 deletions libs/FScreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,9 @@ monitor_assign_virtual(struct monitor *ref)
if (m == ref)
continue;

memcpy(&m->virtual_scr, &ref->virtual_scr, sizeof(m->virtual_scr));
memcpy(
&m->virtual_scr, &ref->virtual_scr,
sizeof(m->virtual_scr));
}
}

Expand Down Expand Up @@ -443,7 +445,10 @@ scan_screens(Display *dpy)
char *name = XGetAtomName(dpy, rrm[i].name);

if (name == NULL) {
fprintf(stderr, "%s: couldn't detect monitor with empty name\n", __func__);
fprintf(
stderr,
"%s: couldn't detect monitor with empty name\n",
__func__);
exit (101);
}

Expand Down Expand Up @@ -570,40 +575,41 @@ monitor_dump_state(struct monitor *m)
}
if (m != NULL && m2 != m)
continue;
fvwm_debug(__func__,
"\tName:\t%s\n"
"\tDisabled:\t%s\n"
"\tIs Primary:\t%s\n"
"\tIs Current:\t%s\n"
"\tOutput:\t%d\n"
"\tCoords:\t{x: %d, y: %d, w: %d, h: %d}\n"
"\tVirtScr: {\n"
"\t\tVxMax: %d, VyMax: %d, Vx: %d, Vy: %d\n"
"\t\tEdgeScrollX: %d, EdgeScrollY: %d\n"
"\t\tCurrentDesk: %d\n"
"\t\tCurrentPage: {x: %d, y: %d}\n"
"\t\tMyDisplayWidth: %d, MyDisplayHeight: %d\n\t}\n"
"\tDesktops:\t%s\n"
"\tFlags:%s\n\n",
m2->si->name,
(m2->flags & MONITOR_DISABLED) ? "true" : "false",
(m2->flags & MONITOR_PRIMARY) ? "yes" : "no",
(mcur && m2 == mcur) ? "yes" : "no",
(int)m2->si->rr_output,
m2->si->x, m2->si->y, m2->si->w, m2->si->h,
m2->virtual_scr.VxMax, m2->virtual_scr.VyMax,
m2->virtual_scr.Vx, m2->virtual_scr.Vy,
m2->virtual_scr.EdgeScrollX,
m2->virtual_scr.EdgeScrollY,
m2->virtual_scr.CurrentDesk,
(int)(m2->virtual_scr.Vx / monitor_get_all_widths()),
(int)(m2->virtual_scr.Vy / monitor_get_all_heights()),
monitor_get_all_widths(),
monitor_get_all_heights(),
m2->Desktops ? "yes" : "no",
monitor_mode == MONITOR_TRACKING_G ? "global" :
monitor_mode == MONITOR_TRACKING_M ? "per-monitor" :
"Unknown"
fvwm_debug(
__func__,
"\tName:\t%s\n"
"\tDisabled:\t%s\n"
"\tIs Primary:\t%s\n"
"\tIs Current:\t%s\n"
"\tOutput:\t%d\n"
"\tCoords:\t{x: %d, y: %d, w: %d, h: %d}\n"
"\tVirtScr: {\n"
"\t\tVxMax: %d, VyMax: %d, Vx: %d, Vy: %d\n"
"\t\tEdgeScrollX: %d, EdgeScrollY: %d\n"
"\t\tCurrentDesk: %d\n"
"\t\tCurrentPage: {x: %d, y: %d}\n"
"\t\tMyDisplayWidth: %d, MyDisplayHeight: %d\n\t}\n"
"\tDesktops:\t%s\n"
"\tFlags:%s\n\n",
m2->si->name,
(m2->flags & MONITOR_DISABLED) ? "true" : "false",
(m2->flags & MONITOR_PRIMARY) ? "yes" : "no",
(mcur && m2 == mcur) ? "yes" : "no",
(int)m2->si->rr_output,
m2->si->x, m2->si->y, m2->si->w, m2->si->h,
m2->virtual_scr.VxMax, m2->virtual_scr.VyMax,
m2->virtual_scr.Vx, m2->virtual_scr.Vy,
m2->virtual_scr.EdgeScrollX,
m2->virtual_scr.EdgeScrollY,
m2->virtual_scr.CurrentDesk,
(int)(m2->virtual_scr.Vx / monitor_get_all_widths()),
(int)(m2->virtual_scr.Vy / monitor_get_all_heights()),
monitor_get_all_widths(),
monitor_get_all_heights(),
m2->Desktops ? "yes" : "no",
monitor_mode == MONITOR_TRACKING_G ? "global" :
monitor_mode == MONITOR_TRACKING_M ? "per-monitor" :
"Unknown"
);
}
}
Expand Down Expand Up @@ -973,7 +979,9 @@ int FScreenParseGeometry(

if (scr != NULL) {
m = monitor_resolve_name(scr);
fprintf(stderr, "Found monitor with name of: %s (%s)\n", scr, m->si->name);
fprintf(
stderr, "Found monitor with name of: %s (%s)\n", scr,
m->si->name);
x = m->si->x;
y = m->si->y;
w = m->si->w;
Expand Down Expand Up @@ -1055,7 +1063,8 @@ int FScreenGetGeometry(

arg.mouse_ev = NULL;
arg.name = scr;
FScreenGetScrRect(&arg, FSCREEN_BY_NAME, &scr_x, &scr_y, &scr_w, &scr_h);
FScreenGetScrRect(
&arg, FSCREEN_BY_NAME, &scr_x, &scr_y, &scr_w, &scr_h);

/* II. Interpret and fill in the values */

Expand Down