Skip to content

Commit

Permalink
logging: minor tweaks
Browse files Browse the repository at this point in the history
Change some of the logging logic to reduce the same information being
printed out when it's not needed.  This mostly applies to when
DebugRandR is turned on.  Additionally, augment the DebugRandR output to
print out EWMHBaseStruts values.
  • Loading branch information
ThomasAdam committed Feb 23, 2024
1 parent 52b29ef commit 403bae7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 24 deletions.
28 changes: 8 additions & 20 deletions fvwm/ewmh.c
Original file line number Diff line number Diff line change
Expand Up @@ -1036,10 +1036,6 @@ void ewmh_ComputeAndSetWorkArea(struct monitor *m)

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 (
Expand All @@ -1055,7 +1051,10 @@ void ewmh_ComputeAndSetWorkArea(struct monitor *m)

if (Scr.bo.do_debug_randr)
{
fvwm_debug(__func__, "differ, so setting work area\n");
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);
}
}

Expand Down Expand Up @@ -1129,16 +1128,6 @@ void EWMH_GetWorkAreaIntersection(
int area_h = m->Desktops->ewmh_working_area.height;
Bool is_dynamic = False;

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);
}

switch(type)
{
case EWMH_IGNORE_WORKING_AREA:
Expand Down Expand Up @@ -1168,10 +1157,9 @@ void EWMH_GetWorkAreaIntersection(
*w = nw;
*h = nh;

if (Scr.bo.do_debug_randr)
{
fvwm_debug(
__func__,
if (Scr.bo.do_debug_randr &&
(*x != area_x || *y != area_y || *w != area_w || *h != area_h)) {
fvwm_debug(__func__,
"mon: %s finalising: {x: %d, y: %d, w: %d, h: %d}\n",
m->si->name, *x, *y, *w, *h);
}
Expand Down Expand Up @@ -2064,4 +2052,4 @@ void EWMH_fullscreen(FvwmWindow *fw)
}

return;
}
}
2 changes: 0 additions & 2 deletions fvwm/ewmh_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ void CMD_EwmhBaseStruts(F_CMD_ARGS)
}

RB_FOREACH(m, monitors, &monitor_q) {
fvwm_debug(__func__, "mon: %s {l: %d, r: %d, t: %d, b: %d}\n",
m->si->name, val[0], val[1], val[2], val[3]);
set_ewmhc_strut_values(m, val);
}
}
Expand Down
2 changes: 0 additions & 2 deletions fvwm/placement.c
Original file line number Diff line number Diff line change
Expand Up @@ -2422,8 +2422,6 @@ Bool setup_window_placement(
e = expand_vars(sc, NULL, False, True, NULL, exc);

start_style.screen = (e != NULL) ? fxstrdup(e) : fxstrdup("");
fvwm_debug(__func__, "Expanding screen from '%s' -> '%s'",
sc ? sc : "null", start_style.screen);
rc = _place_window(
exc, pstyle, attr_g, start_style, mode, win_opts, &reason);

Expand Down
9 changes: 9 additions & 0 deletions libs/FScreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,11 @@ monitor_dump_state(struct monitor *m)
"\t\tCurrentDesk: %d\n"
"\t\tCurrentPage: {x: %d, y: %d}\n"
"\t\tMyDisplayWidth: %d, MyDisplayHeight: %d\n\t}\n"
"\tEWMH: {\n"
"\t\tBaseStrut Top: %d\n"
"\t\tBaseStrut Bottom: %d\n"
"\t\tBaseStrut Left: %d\n"
"\t\tBaseStrut Right: %d\n\t}\n"
"\tDesktops:\t%s\n"
"\tFlags:%s\n\n",
m2->number,
Expand All @@ -724,6 +729,10 @@ monitor_dump_state(struct monitor *m)
(int)(m2->virtual_scr.Vy / monitor_get_all_heights()),
monitor_get_all_widths(),
monitor_get_all_heights(),
m2->ewmhc.BaseStrut.top,
m2->ewmhc.BaseStrut.bottom,
m2->ewmhc.BaseStrut.left,
m2->ewmhc.BaseStrut.right,
m2->Desktops ? "yes" : "no",
monitor_mode == MONITOR_TRACKING_G ? "global" :
monitor_mode == MONITOR_TRACKING_M ? "per-monitor" :
Expand Down

0 comments on commit 403bae7

Please sign in to comment.