aboutsummaryrefslogtreecommitdiffstats
path: root/xevents.c
diff options
context:
space:
mode:
authorokan2019-03-10 22:53:11 +0000
committerokan2019-03-10 22:53:11 +0000
commit63b04a6fe846e4bfab249a1f3e496ab04511b299 (patch)
tree77eb3277bcec786c1ba1804effda53e8ff30ed4f /xevents.c
parentb81d279086738e468d862b7f210f6fb0bc73366d (diff)
downloadcwm-63b04a6fe846e4bfab249a1f3e496ab04511b299.tar.gz
use screen_find() for xrandr crtc changes
Diffstat (limited to '')
-rw-r--r--xevents.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/xevents.c b/xevents.c
index 3733419..ce3f740 100644
--- a/xevents.c
+++ b/xevents.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: xevents.c,v 1.144 2019/03/10 20:38:28 okan Exp $
+ * $OpenBSD: xevents.c,v 1.145 2019/03/10 22:53:11 okan Exp $
*/
/*
@@ -431,20 +431,17 @@ xev_handle_clientmessage(XEvent *ee)
static void
xev_handle_randr(XEvent *ee)
{
- XRRScreenChangeNotifyEvent *rev = (XRRScreenChangeNotifyEvent *)ee;
+ XRRScreenChangeNotifyEvent *e = (XRRScreenChangeNotifyEvent *)ee;
struct screen_ctx *sc;
- int i;
- LOG_DEBUG3("new size: %d/%d", rev->width, rev->height);
+ LOG_DEBUG3("size: %d/%d", e->width, e->height);
- i = XRRRootToScreen(X_Dpy, rev->root);
- TAILQ_FOREACH(sc, &Screenq, entry) {
- if (sc->which == i) {
- XRRUpdateConfiguration(ee);
- screen_update_geometry(sc);
- screen_assert_clients_within(sc);
- }
- }
+ if ((sc = screen_find(e->root)) == NULL)
+ return;
+
+ XRRUpdateConfiguration(ee);
+ screen_update_geometry(sc);
+ screen_assert_clients_within(sc);
}
/*