X-Git-Url: http://git.mutantstargoat.com?p=winnie;a=blobdiff_plain;f=src%2Fwm.cc;h=621a23f3366066954a73033851939f08d52657a2;hp=cbb5443687deb22620933990efddfea556f0a255;hb=9261ecb0ad85bdf8b21e17b7309ddaeb76a57d96;hpb=e2626c41c841dbbfb64ddf6341b4e23089036299 diff --git a/src/wm.cc b/src/wm.cc index cbb5443..621a23f 100644 --- a/src/wm.cc +++ b/src/wm.cc @@ -27,10 +27,11 @@ Author: Eleni Maria Stea #include "gfx.h" #include "mouse.h" #include "mouse_cursor.h" +#include "shalloc.h" #include "text.h" -#include "wm.h" #include "window.h" #include "winnie.h" +#include "wm.h" #define DCLICK_INTERVAL 400 @@ -42,16 +43,22 @@ static void motion(Window *win, int x, int y); bool init_window_manager() { - if(!(wm = new WindowManager)) { + void *wm_mem; + if(!(wm_mem = sh_malloc(sizeof *wm))) { return false; } + wm = new (wm_mem) WindowManager; + + get_subsys()->wm_offset = (int)((char*)wm - (char*)get_pool()); + return true; } void destroy_window_manager() { - delete wm; + wm->~WindowManager(); + sh_free(wm); } void WindowManager::create_frame(Window *win)