Skip to content

Commit 403bae7

Browse files
committed
logging: minor tweaks
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.
1 parent 52b29ef commit 403bae7

File tree

4 files changed

+17
-24
lines changed

4 files changed

+17
-24
lines changed

‎fvwm/ewmh.c‎

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,10 +1036,6 @@ void ewmh_ComputeAndSetWorkArea(struct monitor *m)
10361036

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

10451041
if (
@@ -1055,7 +1051,10 @@ void ewmh_ComputeAndSetWorkArea(struct monitor *m)
10551051

10561052
if (Scr.bo.do_debug_randr)
10571053
{
1058-
fvwm_debug(__func__, "differ, so setting work area\n");
1054+
fvwm_debug(__func__, "monitor '%s': "
1055+
"{l: %d, r: %d, t: %d, b: %d} "
1056+
"{x: %d, y: %d, w: %d, h: %d}\n", m->si->name,
1057+
left, right, top, bottom, x, y, width, height);
10591058
}
10601059
}
10611060

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

1132-
if (Scr.bo.do_debug_randr)
1133-
{
1134-
fvwm_debug(
1135-
__func__, "mon: %s {ax: %d, ay: %d, aw: %d, ah: %d\n",
1136-
m->si->name, area_x, area_y, area_w, area_h);
1137-
fvwm_debug(
1138-
__func__, "mon: %s {x: %d, y: %d, w: %d, h: %d\n",
1139-
m->si->name, *x, *y, *w, *h);
1140-
}
1141-
11421131
switch(type)
11431132
{
11441133
case EWMH_IGNORE_WORKING_AREA:
@@ -1168,10 +1157,9 @@ void EWMH_GetWorkAreaIntersection(
11681157
*w = nw;
11691158
*h = nh;
11701159

1171-
if (Scr.bo.do_debug_randr)
1172-
{
1173-
fvwm_debug(
1174-
__func__,
1160+
if (Scr.bo.do_debug_randr &&
1161+
(*x != area_x || *y != area_y || *w != area_w || *h != area_h)) {
1162+
fvwm_debug(__func__,
11751163
"mon: %s finalising: {x: %d, y: %d, w: %d, h: %d}\n",
11761164
m->si->name, *x, *y, *w, *h);
11771165
}
@@ -2064,4 +2052,4 @@ void EWMH_fullscreen(FvwmWindow *fw)
20642052
}
20652053

20662054
return;
2067-
}
2055+
}

‎fvwm/ewmh_conf.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ void CMD_EwmhBaseStruts(F_CMD_ARGS)
172172
}
173173

174174
RB_FOREACH(m, monitors, &monitor_q) {
175-
fvwm_debug(__func__, "mon: %s {l: %d, r: %d, t: %d, b: %d}\n",
176-
m->si->name, val[0], val[1], val[2], val[3]);
177175
set_ewmhc_strut_values(m, val);
178176
}
179177
}

‎fvwm/placement.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2422,8 +2422,6 @@ Bool setup_window_placement(
24222422
e = expand_vars(sc, NULL, False, True, NULL, exc);
24232423

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

‎libs/FScreen.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,11 @@ monitor_dump_state(struct monitor *m)
705705
"\t\tCurrentDesk: %d\n"
706706
"\t\tCurrentPage: {x: %d, y: %d}\n"
707707
"\t\tMyDisplayWidth: %d, MyDisplayHeight: %d\n\t}\n"
708+
"\tEWMH: {\n"
709+
"\t\tBaseStrut Top: %d\n"
710+
"\t\tBaseStrut Bottom: %d\n"
711+
"\t\tBaseStrut Left: %d\n"
712+
"\t\tBaseStrut Right: %d\n\t}\n"
708713
"\tDesktops:\t%s\n"
709714
"\tFlags:%s\n\n",
710715
m2->number,
@@ -724,6 +729,10 @@ monitor_dump_state(struct monitor *m)
724729
(int)(m2->virtual_scr.Vy / monitor_get_all_heights()),
725730
monitor_get_all_widths(),
726731
monitor_get_all_heights(),
732+
m2->ewmhc.BaseStrut.top,
733+
m2->ewmhc.BaseStrut.bottom,
734+
m2->ewmhc.BaseStrut.left,
735+
m2->ewmhc.BaseStrut.right,
727736
m2->Desktops ? "yes" : "no",
728737
monitor_mode == MONITOR_TRACKING_G ? "global" :
729738
monitor_mode == MONITOR_TRACKING_M ? "per-monitor" :

0 commit comments

Comments
 (0)