From 4e1d3ffcec845b5618f6ac8a2b2c8ad40dadbceb Mon Sep 17 00:00:00 2001 From: sabetts Date: Thu, 16 Mar 2006 01:41:13 +0000 Subject: 2006-03-15 Bernhard R. Link * src/screen.c (screen_update): new function (init_screen): listen for screen resizes * src/screen.h: new prototype * src/events.c (configure_notify): new function (delegate_event): call configure_notify for ConfigureNotify events * src/frame.c (frame_dump): remember the size of the screen the frame coordinates are relative to. (frame_restore): adopt coordinates to possible screen resizes. * src/frame.h (frame_fump): take a screen argument (frame_read): likewise * src/actions.c (cmd_tmpwm): listen for screen resizes again (fdump, frestore, cmd_fdump): supply screen to frame_dump, frameread --- src/events.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/events.c') diff --git a/src/events.c b/src/events.c index 7e6e9ca..ad43cfe 100644 --- a/src/events.c +++ b/src/events.c @@ -702,6 +702,18 @@ mapping_notify (XMappingEvent *ev) grab_keys_all_wins(); } +static void +configure_notify (XConfigureEvent *ev) +{ + rp_screen *s; + + s = find_screen(ev->window); + if (s != NULL) + /* This is a root window of a screen, + * look if its width or height changed: */ + screen_update(s,ev->width,ev->height); +} + /* This is called whan an application has requested the selection. Copied from rxvt. */ static void @@ -847,6 +859,10 @@ delegate_event (XEvent *ev) break; case ConfigureNotify: + PRINT_DEBUG (("--- Handling ConfigureNotify ---\n")); + configure_notify( &ev->xconfigure ); + break; + case MapNotify: case Expose: case MotionNotify: -- cgit v1.2.3