diff options
author | sabetts <sabetts> | 2003-03-26 02:42:05 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2003-03-26 02:42:05 +0000 |
commit | 84ee56d66b889363903eddd81a8b2a07f180656f (patch) | |
tree | 6f7d51890ffbe521774f2a633e385d296458ba51 /src/actions.c | |
parent | 71a80e9852ad1de0fb88174ca9242a8dddcde384 (diff) | |
download | ratpoison-84ee56d66b889363903eddd81a8b2a07f180656f.zip |
* src/split.h (show_frame_message): new prototype
* src/split.c (show_frame_message): new function
* src/main.c (init_screen): listen for key release events in the
key_window and input_window.
* src/input.c (read_key): new argument, gobble_rel. All callers
updated.
* src/actions.c (cmd_remove): only remove the current frame if it
isn't the ONLY one.
(cmd_remove): display a message informing the user if the frame
cannot be removed.
(cmd_resize): clean up resize loop.
(cmd_resize): display a window indicating which frame is being
resized.
Diffstat (limited to 'src/actions.c')
-rw-r--r-- | src/actions.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/actions.c b/src/actions.c index 82fac46..8e18bf2 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1381,9 +1381,16 @@ cmd_only (int interactive, void *data) char * cmd_remove (int interactive, void *data) { + screen_info *s = current_screen(); rp_window_frame *frame; - frame = find_frame_next (current_screen()->rp_current_frame); + if (num_frames(s) <= 1) + { + message (" remove: cannot remove only frame "); + return NULL; + } + + frame = find_frame_next (s->rp_current_frame); if (frame) { @@ -1425,9 +1432,11 @@ cmd_resize (int interactive, void *data) XGetInputFocus (dpy, &fwin, &revert); XSetInputFocus (dpy, s->key_window, RevertToPointerRoot, CurrentTime); - nbytes = read_key (&c, &mod, buffer, sizeof (buffer)); while (1) { + show_frame_message (" Resize frame "); + nbytes = read_key (&c, &mod, buffer, sizeof (buffer), 1); + if (c == RESIZE_VGROW_KEY && mod == RESIZE_VGROW_MODIFIER) resize_frame_vertically (s->rp_current_frame, defaults.frame_resize_unit); else if (c == RESIZE_VSHRINK_KEY && mod == RESIZE_VSHRINK_MODIFIER) @@ -1441,10 +1450,9 @@ cmd_resize (int interactive, void *data) resize_shrink_to_window (s->rp_current_frame); else if (c == RESIZE_END_KEY && mod == RESIZE_END_MODIFIER) break; - - nbytes = read_key (&c, &mod, buffer, sizeof (buffer)); } + hide_frame_indicator (); XSetInputFocus (dpy, fwin, RevertToPointerRoot, CurrentTime); } else @@ -2914,7 +2922,7 @@ cmd_fselect (int interactive, void *data) /* Read a key. */ XGetInputFocus (dpy, &fwin, &revert); XSetInputFocus (dpy, s->key_window, RevertToPointerRoot, CurrentTime); - read_key (&c, &mod, NULL, 0); + read_key (&c, &mod, NULL, 0, 1); XSetInputFocus (dpy, fwin, RevertToPointerRoot, CurrentTime); /* Destroy our number windows and free the array. */ |