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

Deprecate HAVE_XRandR/FScreenIsEnabled() #410

Merged
merged 2 commits into from
Jan 20, 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: 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
4 changes: 0 additions & 4 deletions fvwm/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -1765,7 +1765,6 @@ static void __refocus_stolen_focus_win(const evh_args_t *ea)

/* ---------------------------- event handlers ----------------------------- */

#ifdef HAVE_XRANDR
void monitor_update_ewmh(void)
{
FvwmWindow *t;
Expand Down Expand Up @@ -1831,7 +1830,6 @@ monitor_emit_broadcast(void)
}
}
}
#endif

void HandleButtonPress(const evh_args_t *ea)
{
Expand Down Expand Up @@ -4078,7 +4076,6 @@ void dispatch_event(XEvent *e)

XFlush(dpy);

#if HAVE_XRANDR
XRRScreenChangeNotifyEvent *sce;

switch (e->type - randr_event) {
Expand All @@ -4091,7 +4088,6 @@ void dispatch_event(XEvent *e)
break;
}
}
#endif

if (w == Scr.Root)
{
Expand Down
2 changes: 0 additions & 2 deletions fvwm/fvwm3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1305,9 +1305,7 @@ static void setVersionInfo(void)
#ifdef HAVE_BIDI
strcat(support_str, " Bidi text,");
#endif
#ifdef HAVE_XRANDR
strcat(support_str, " XRandR,");
#endif
#ifdef HAVE_XRENDER
strcat(support_str, " XRender,");
#endif
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
13 changes: 1 addition & 12 deletions libs/FScreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@
#include "FScreen.h"
#include "FEvent.h"

#ifdef HAVE_XRANDR
# define IS_RANDR_ENABLED 1
#else
# define IS_RANDR_ENABLED 0
#endif

#define GLOBAL_SCREEN_NAME "_global"

/* In fact, only corners matter -- there will never be GRAV_NONE */
Expand Down Expand Up @@ -76,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 @@ -489,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
5 changes: 1 addition & 4 deletions libs/fvwm_x11.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <X11/cursorfont.h>
#include <X11/Xproto.h>
#include <X11/Intrinsic.h>
#include <X11/extensions/Xrandr.h>

#ifdef XPM
#define XpmSupport 1
Expand Down Expand Up @@ -46,10 +47,6 @@ typedef Picture XRenderPicture;
#include <fontconfig/fontconfig.h>
#endif

#ifdef HAVE_XRANDR
#include <X11/extensions/Xrandr.h>
#endif

#ifdef SHAPE
#include <X11/extensions/shape.h>
#endif
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