X-Git-Url: http://git.mutantstargoat.com?a=blobdiff_plain;f=src%2Fwm.cc;h=7c5959eb5ef08def8cff2a626b86f6825f4fe7db;hb=5984d5479693fd7519674a5bc40ebf804f8d0a46;hp=7fe13fbcf6a1929a38661722bdab202f5151ee28;hpb=52044efd7717f4b02bd463c9a26f83c9a41953ea;p=winnie diff --git a/src/wm.cc b/src/wm.cc index 7fe13fb..7c5959e 100644 --- a/src/wm.cc +++ b/src/wm.cc @@ -10,12 +10,25 @@ #include "window.h" WindowManager *wm; -static WindowManager wminst; static void display(Window *win); static void mouse(Window *win, int bn, bool pressed, int x, int y); static void motion(Window *win, int x, int y); +bool init_window_manager() +{ + if(!(wm = new WindowManager)) { + return false; + } + + return true; +} + +void destroy_window_manager() +{ + delete wm; +} + void WindowManager::create_frame(Window *win) { Window *frame = new Window; @@ -72,6 +85,7 @@ WindowManager::WindowManager() root_win->move(0, 0); root_win->set_managed(false); + grab_win = 0; focused_win = 0; bg_color[0] = 210; @@ -81,8 +95,8 @@ WindowManager::WindowManager() frame_thickness = 8; titlebar_thickness = 16; - set_focused_frame_color(36, 59, 98); - set_unfocused_frame_color(80, 129, 162); + set_focused_frame_color(0, 0, 0); + set_unfocused_frame_color(200, 200, 200); mouse_cursor.set_image(mouse_cursor_width, mouse_cursor_height); unsigned char *pixels = mouse_cursor.get_image(); @@ -358,7 +372,6 @@ static void mouse(Window *win, int bn, bool pressed, int x, int y) static void motion(Window *win, int x, int y) { int left_bn = get_button(0); - int right_button = get_button(2); if(left_bn) { int dx = x - prev_x;