From 8da54ca0eb91e0595b506725369ede0a6426d795 Mon Sep 17 00:00:00 2001 From: markt Date: Tue, 31 Jul 2007 23:16:05 +0000 Subject: [PATCH] add some decorations to torn menus, and fix restart without an argument --- ChangeLog | 3 +++ src/Ewmh.cc | 7 +++++-- src/FbTk/XmbFontImp.cc | 4 +++- src/main.cc | 16 +++++++++------- util/fbrun/FbRun.cc | 8 ++++---- util/fbrun/fbrun.xpm | 2 +- 6 files changed, 25 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 660f1c77..47d61f67 100644 --- a/ChangeLog +++ b/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) diff --git a/src/Ewmh.cc b/src/Ewmh.cc index afab9386..fef44287 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc @@ -310,8 +310,7 @@ void Ewmh::setupFrame(FluxboxWindow &win) { } 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 @@ void Ewmh::setupFrame(FluxboxWindow &win) { * 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); diff --git a/src/FbTk/XmbFontImp.cc b/src/FbTk/XmbFontImp.cc index 025f96d0..3a45b094 100644 --- a/src/FbTk/XmbFontImp.cc +++ b/src/FbTk/XmbFontImp.cc @@ -115,7 +115,9 @@ const char *getFontElement(const char *pattern, char *buf, int bufsiz, ...) { 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(constdef); int nmissing; string orig_locale = ""; diff --git a/src/main.cc b/src/main.cc index 2d1ff0df..45541238 100644 --- a/src/main.cc +++ b/src/main.cc @@ -321,14 +321,16 @@ int main(int argc, char **argv) { 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 diff --git a/util/fbrun/FbRun.cc b/util/fbrun/FbRun.cc index 908b3c24..8d449b33 100644 --- a/util/fbrun/FbRun.cc +++ b/util/fbrun/FbRun.cc @@ -79,8 +79,8 @@ FbRun::FbRun(int x, int y, size_t width): 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("fbrun"); + class_hint->res_class = const_cast("FbRun"); XSetClassHint(m_display, window(), class_hint); XFree(class_hint); @@ -89,7 +89,7 @@ FbRun::FbRun(int x, int y, size_t width): Pixmap pm; XpmCreatePixmapFromData(m_display, window(), - fbrun_xpm, + const_cast(fbrun_xpm), &pm, &mask, 0); // attribs @@ -120,7 +120,7 @@ void FbRun::run(const std::string &command) { // fork and execute program if (!fork()) { - char *shell = getenv("SHELL"); + const char *shell = getenv("SHELL"); if (!shell) shell = "/bin/sh"; diff --git a/util/fbrun/fbrun.xpm b/util/fbrun/fbrun.xpm index 856f214b..0ee2c182 100644 --- a/util/fbrun/fbrun.xpm +++ b/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",