X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FBaseDisplay.cc;h=b9143b77abc3a5b7a36672e636fbacad215fa1fa;hb=66e3f4d0600eeb8c642dc2f3b3320a3e9af075e3;hp=852fa8ca894477a74becd8291e66244b3dba3b9b;hpb=72af8cea6a0573f7d2c004102cd04f1a1ad88798;p=chaz%2Fopenbox diff --git a/src/BaseDisplay.cc b/src/BaseDisplay.cc index 852fa8ca..b9143b77 100644 --- a/src/BaseDisplay.cc +++ b/src/BaseDisplay.cc @@ -48,10 +48,13 @@ # include #endif // HAVE_STDIO_H -#ifdef STDC_HEADERS +#ifdef HAVE_STDLIB_H # include +#endif // HAVE_STDLIB_H + +#ifdef HAVE_STRING_H # include -#endif // STDC_HEADERS +#endif // HAVE_STRING_H #ifdef HAVE_UNISTD_H # include @@ -191,8 +194,8 @@ char *bstrdup(const char *s) { return n; } -BaseDisplay::BaseDisplay(char *app_name, char *dpy_name) { - application_name = app_name; +BaseDisplay::BaseDisplay(const char *app_name, char *dpy_name) { + application_name = bstrdup(app_name); _startup = True; _shutdown = False; @@ -574,16 +577,17 @@ void BaseDisplay::ungrabButton(unsigned int button, unsigned int modifiers, } -ScreenInfo::ScreenInfo(BaseDisplay &d, int num) : basedisplay(d) { - screen_number = num; +ScreenInfo::ScreenInfo(BaseDisplay &d, int num) : basedisplay(d), + screen_number(num) +{ root_window = RootWindow(basedisplay.getXDisplay(), screen_number); depth = DefaultDepth(basedisplay.getXDisplay(), screen_number); - width = - WidthOfScreen(ScreenOfDisplay(basedisplay.getXDisplay(), screen_number)); - height = - HeightOfScreen(ScreenOfDisplay(basedisplay.getXDisplay(), screen_number)); + m_size = Size(WidthOfScreen(ScreenOfDisplay(basedisplay.getXDisplay(), + screen_number)), + HeightOfScreen(ScreenOfDisplay(basedisplay.getXDisplay(), + screen_number))); // search for a TrueColor Visual... if we can't find one... we will use the // default visual for the screen