add some decorations to torn menus, and fix restart without an argument
markt markt
6 files changed,
25 insertions(+),
15 deletions(-)
M
ChangeLog
→
ChangeLog
@@ -1,5 +1,8 @@
(Format: Year/Month/Day) Changes for 1.0.0: +*07/07/31: + * Change _NET_WM_WINDOW_TYPE_MENU to use TINY decoration type (Mark) + Ewmh.cc *07/07/24: * Don't allow ToggleDecor with fullscreen windows, and make it show decorations for windows that don't have a titlebar by default (Mark)
M
src/Ewmh.cc
→
src/Ewmh.cc
@@ -310,8 +310,7 @@ // do nothing, this is ..normal..
} else if (atoms[l] == m_net_wm_window_type_dialog) { // dialog windows should not be tabable win.setTabable(false); - } else if (atoms[l] == m_net_wm_window_type_menu || - atoms[l] == m_net_wm_window_type_toolbar) { + } else if (atoms[l] == m_net_wm_window_type_menu) { /* * _NET_WM_WINDOW_TYPE_TOOLBAR and _NET_WM_WINDOW_TYPE_MENU * indicate toolbar and pinnable menu windows, respectively@@ -319,6 +318,10 @@ * (i.e. toolbars and menus "torn off" from the main
* application). Windows of this type may set the * WM_TRANSIENT_FOR hint indicating the main application window. */ + win.setDecoration(FluxboxWindow::DECOR_TINY); + win.setIconHidden(true); + win.moveToLayer(Layer::ABOVE_DOCK); + } else if (atoms[l] == m_net_wm_window_type_toolbar) { win.setDecoration(FluxboxWindow::DECOR_NONE); win.setIconHidden(true); win.moveToLayer(Layer::ABOVE_DOCK);
M
src/FbTk/XmbFontImp.cc
→
src/FbTk/XmbFontImp.cc
@@ -115,7 +115,9 @@
XFontSet createFontSet(const char *fontname, bool& utf8mode) { Display *display = FbTk::App::instance()->display(); XFontSet fs; - char **missing, *def = "-"; + char **missing; + const char *constdef = "-"; + char *def = const_cast<char *>(constdef); int nmissing; string orig_locale = "";
M
src/main.cc
→
src/main.cc
@@ -321,14 +321,16 @@
FbTk::FbStringUtil::shutdown(); if (restarting) { - const char *shell = getenv("SHELL"); - if (!shell) - shell = "/bin/sh"; + if (!restart_argument.empty()) { + const char *shell = getenv("SHELL"); + if (!shell) + shell = "/bin/sh"; - const char *arg = restart_argument.c_str(); - if (arg) { - execlp(shell, shell, "-c", arg, (char *) NULL); - perror(arg); + const char *arg = restart_argument.c_str(); + if (arg) { + execlp(shell, shell, "-c", arg, (const char *) NULL); + perror(arg); + } } // fall back in case the above execlp doesn't work
M
util/fbrun/FbRun.cc
→
util/fbrun/FbRun.cc
@@ -79,8 +79,8 @@ // setup class name
XClassHint *class_hint = XAllocClassHint(); if (class_hint == 0) throw string("Out of memory"); - class_hint->res_name = "fbrun"; - class_hint->res_class = "FbRun"; + class_hint->res_name = const_cast<char *>("fbrun"); + class_hint->res_class = const_cast<char *>("FbRun"); XSetClassHint(m_display, window(), class_hint); XFree(class_hint);@@ -89,7 +89,7 @@ Pixmap mask = 0;
Pixmap pm; XpmCreatePixmapFromData(m_display, window(), - fbrun_xpm, + const_cast<char **>(fbrun_xpm), &pm, &mask, 0); // attribs@@ -120,7 +120,7 @@
// fork and execute program if (!fork()) { - char *shell = getenv("SHELL"); + const char *shell = getenv("SHELL"); if (!shell) shell = "/bin/sh";
M
util/fbrun/fbrun.xpm
→
util/fbrun/fbrun.xpm
@@ -1,5 +1,5 @@
/* XPM */ -static char * fbrun_xpm[] = { +static const char * fbrun_xpm[] = { "32 32 433 2", " c None", ". c #000000",