summaryrefslogtreecommitdiff
path: root/src/manage.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2001-03-01 05:01:29 +0000
committersabetts <sabetts>2001-03-01 05:01:29 +0000
commitdb8f252fca8d05f3f79ecbec76b85bb89df5581d (patch)
tree6a0d2095b805603c407f4bdda9c88bfb5d5af6b1 /src/manage.c
parent811441c3d6f45b4d6eebbf919dac160619a3a389 (diff)
downloadratpoison-db8f252fca8d05f3f79ecbec76b85bb89df5581d.zip
* manage.c (map_window): calls update_window_information.
* manage.h (map_window): new prototype. * events.c (new_window): calls update_window_information on new windows. (map_request): calls map_window on managed unmapped windows. (configure_request): removed commented out old crusty code. Updates window's structure based on what bits are set in the event's value_mask. Doesn't honour resize request. Windows are always maximized. (property_notify): doesn't call maximize when WM_NORMAL_HINTS are updated. * manage.c (manage): no longer maps the window, this code is in map_window. (map_window): new function (maximize): no longer sends a synthetic configure event. (scanwins): calls map_window on viewable windows. (update_window_information): renamed from manage. dependant code updated.
Diffstat (limited to 'src/manage.c')
-rw-r--r--src/manage.c56
1 files changed, 30 insertions, 26 deletions
diff --git a/src/manage.c b/src/manage.c
index be2613e..0eb0e28 100644
--- a/src/manage.c
+++ b/src/manage.c
@@ -174,7 +174,7 @@ send_configure (rp_window *win)
}
void
-manage (rp_window *win, screen_info *s)
+update_window_information (rp_window *win)
{
XWindowAttributes attr;
@@ -192,26 +192,6 @@ manage (rp_window *win, screen_info *s)
win->y = attr.y;
win->width = attr.width;
win->height = attr.height;
-
- /* We successfully got the name, which means we can start managing! */
- XSelectInput (dpy, win->w, PropertyChangeMask | ColormapChangeMask);
- XAddToSaveSet(dpy, win->w);
- grab_prefix_key (win->w);
-
- maximize (win);
-
- XMapWindow (dpy, win->w);
-
- win->state = STATE_MAPPED;
- win->number = get_unique_window_number ();
-
- /* Put win in the mapped window list */
- remove_from_list (win);
- insert_into_list (win, rp_mapped_window_sentinel);
-
-/* sort_window_list_by_number(); */
-
- PRINT_DEBUG ("window '%s' managed.\n", win->name);
}
void
@@ -259,10 +239,14 @@ scanwins(screen_info *s)
if (attr.override_redirect != True && !unmanaged_window (wins[i]))
{
-
win = add_to_window_list (s, wins[i]);
+
PRINT_DEBUG ("map_state: %d\n", attr.map_state);
- if (attr.map_state == IsViewable) manage (win, s);
+ if (attr.map_state == IsViewable)
+ {
+ map_window (win);
+ }
+
}
}
XFree((void *) wins); /* cast is to shut stoopid compiler up */
@@ -422,9 +406,6 @@ maximize (rp_window *win)
/* Actually do the maximizing */
XMoveResizeWindow (dpy, win->w, win->x, win->y, win->width, win->height);
- /* I don't think this should be here, but it doesn't seem to hurt. */
- send_configure (win);
-
XSync (dpy, False);
}
@@ -444,3 +425,26 @@ force_maximize (rp_window *win)
XSync (dpy, False);
}
+
+/* map the unmapped window win */
+void
+map_window (rp_window *win)
+{
+ PRINT_DEBUG ("Mapping the unmapped window %s\n", win->name);
+
+ update_window_information (win);
+ grab_prefix_key (win->w);
+
+ maximize (win);
+
+ XMapWindow (dpy, win->w);
+ set_state (win, NormalState);
+ set_active_window (win);
+
+ win->state = STATE_MAPPED;
+ win->number = get_unique_window_number ();
+
+ /* Put win in the mapped window list */
+ remove_from_list (win);
+ insert_into_list (win, rp_mapped_window_sentinel);
+}