Skip to content

Commit

Permalink
Deprecate FScreenIsEnabled()
Browse files Browse the repository at this point in the history
In fvwm2, Xinerama support was optional, and as such, fvwmlib had to
predicate against that by callers using FScreenIsEnabled().  However,
since RandR support is now mandatory, this function is no longer
required.
  • Loading branch information
ThomasAdam committed Jan 20, 2021
1 parent d20e90a commit 427bbf3
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 40 deletions.
2 changes: 1 addition & 1 deletion fvwm/conditional.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ Bool MatchesConditionMask(FvwmWindow *fw, WindowConditionMask *mask)
if (mask->my_flags.do_check_page ||
mask->my_flags.do_check_desk_and_page)
{
if (FScreenIsEnabled() && !mask->my_flags.do_not_check_screen)
if (!mask->my_flags.do_not_check_screen)
{
is_on_page = !!FScreenIsRectangleOnScreen(
NULL, FSCREEN_CURRENT, &(fw->g.frame));
Expand Down
2 changes: 1 addition & 1 deletion fvwm/move_resize.c
Original file line number Diff line number Diff line change
Expand Up @@ -2260,7 +2260,7 @@ static void DoSnapAttract(
}
}
/* Resist moving windows between xineramascreens */
if (fw->edge_resistance_xinerama_move > 0 && FScreenIsEnabled())
if (fw->edge_resistance_xinerama_move)
{
int scr_x0, scr_y0;
int scr_x1, scr_y1;
Expand Down
57 changes: 27 additions & 30 deletions fvwm/placement.c
Original file line number Diff line number Diff line change
Expand Up @@ -2131,39 +2131,36 @@ static void __explain_placement(FvwmWindow *fw, pl_reason_t *reason)
s += strlen(s);
}
/* screen */
if (FScreenIsEnabled() == True)
switch (reason->screen.reason)
{
case PR_SCREEN_CURRENT:
r = "current screen";
break;
case PR_SCREEN_STYLE:
r = "specified by style";
break;
case PR_SCREEN_X_RESOURCE_FVWMSCREEN:
r = "specified by 'fvwmscreen' X resource";
break;
case PR_SCREEN_IGNORE_CAPTURE:
r = "window was (re)captured";
break;
default:
r = "bug";
break;
}
sprintf(
s, " screen: %s: %d %d %dx%d (%s)\n",
reason->screen.screen, reason->screen.g.x,
reason->screen.g.y, reason->screen.g.width,
reason->screen.g.height, r);
s += strlen(s);
if (reason->screen.was_modified_by_ewmh_workingarea == 1)
{
switch (reason->screen.reason)
{
case PR_SCREEN_CURRENT:
r = "current screen";
break;
case PR_SCREEN_STYLE:
r = "specified by style";
break;
case PR_SCREEN_X_RESOURCE_FVWMSCREEN:
r = "specified by 'fvwmscreen' X resource";
break;
case PR_SCREEN_IGNORE_CAPTURE:
r = "window was (re)captured";
break;
default:
r = "bug";
break;
}
sprintf(
s, " screen: %s: %d %d %dx%d (%s)\n",
reason->screen.screen, reason->screen.g.x,
reason->screen.g.y, reason->screen.g.width,
reason->screen.g.height, r);
s, " (screen area modified by EWMH working"
" area)\n");
s += strlen(s);
if (reason->screen.was_modified_by_ewmh_workingarea == 1)
{
sprintf(
s, " (screen area modified by EWMH working"
" area)\n");
s += strlen(s);
}
}
/* position */
is_placed_by_algo = 0;
Expand Down
7 changes: 1 addition & 6 deletions libs/FScreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ static void GetMouseXY(XEvent *eventp, int *x, int *y)
disp, DefaultRootWindow(disp), eventp, x, y);
}

Bool FScreenIsEnabled(void)
{
return (IS_RANDR_ENABLED);
}

struct monitor *
monitor_new(void)
{
Expand Down Expand Up @@ -483,7 +478,7 @@ void FScreenInit(Display *dpy)
is_randr_present = true;


if (FScreenIsEnabled() && !is_randr_present) {
if (!is_randr_present) {
/* Something went wrong. */
fvwm_debug(__func__, "Couldn't initialise XRandR: %s\n",
strerror(errno));
Expand Down
1 change: 0 additions & 1 deletion libs/FScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ extern int randr_event;
extern const char *prev_focused_monitor;

/* Control */
Bool FScreenIsEnabled(void);
void FScreenInit(Display *dpy);
void FScreenSelect(Display *dpy);
void FScreenSetPrimaryScreen(int scr);
Expand Down
2 changes: 1 addition & 1 deletion modules/FvwmIdent/FvwmIdent.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ void list_configure(unsigned long *body)

target.monitor_id = cfgpacket->monitor_id;
target.monitor = fxstrdup("unknown");
if (FScreenIsEnabled()) {
{
free(target.monitor);
target.monitor = fxstrdup(
monitor_by_output((int)target.monitor_id)->si->name);
Expand Down

0 comments on commit 427bbf3

Please sign in to comment.