diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c index d3731ae4..21fbcb4a 100644 --- a/WPrefs.app/Expert.c +++ b/WPrefs.app/Expert.c @@ -132,6 +132,11 @@ static struct expert_option { { N_("Allow windows to take focus using mouse wheel."), /* default: */ False, OPTION_WMAKER, "MouseWheelFocus"}, + +#ifdef USE_RANDR + { N_("Automatically (de)activate monitors on hotplug events."), + /* default: */ False, OPTION_WMAKER, "HotplugMonitor"}, +#endif }; diff --git a/src/WindowMaker.h b/src/WindowMaker.h index cd2c9b48..f979573f 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -410,6 +410,9 @@ extern struct WPreferences { char dont_blink; /* do not blink icon selection */ char keep_dock_on_primary_head; /* keep dock on primary head */ +#ifdef USE_RANDR + char hotplug_monitor; /* auto-(de)activate monitors */ +#endif /* Appearance options */ char new_style; /* Use newstyle buttons */ diff --git a/src/defaults.c b/src/defaults.c index d5d81a2d..101e4dc1 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -5,7 +5,6 @@ * Copyright (c) 1997-2003 Alfredo K. Kojima * Copyright (c) 1998-2003 Dan Pascu * Copyright (c) 2014-2026 Window Maker Team - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -527,6 +526,10 @@ WDefaultEntry optionList[] = { {"KeepDockOnPrimaryHead", "NO", NULL, &wPreferences.keep_dock_on_primary_head, getBool, updateDock, NULL, NULL}, +#ifdef USE_RANDR + {"HotplugMonitor", "NO", NULL, + &wPreferences.hotplug_monitor, getBool, NULL, NULL, NULL}, +#endif {"HotCorners", "NO", NULL, &wPreferences.hot_corners, getBool, NULL, NULL, NULL}, {"HotCornerDelay", "250", (void *)&wPreferences.hot_corner_delay,