add some decorations to torn menus, and fix restart without an argument

This commit is contained in:
markt 2007-07-31 23:16:05 +00:00
parent 363764db5b
commit 8da54ca0eb
6 changed files with 25 additions and 15 deletions

View file

@ -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)

View file

@ -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);

View file

@ -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<char *>(constdef);
int nmissing;
string orig_locale = "";

View file

@ -321,15 +321,17 @@ int main(int argc, char **argv) {
FbTk::FbStringUtil::shutdown();
if (restarting) {
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);
execlp(shell, shell, "-c", arg, (const char *) NULL);
perror(arg);
}
}
// fall back in case the above execlp doesn't work
execvp(argv[0], argv);

View file

@ -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<char *>("fbrun");
class_hint->res_class = const_cast<char *>("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<char **>(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";

View file

@ -1,5 +1,5 @@
/* XPM */
static char * fbrun_xpm[] = {
static const char * fbrun_xpm[] = {
"32 32 433 2",
" c None",
". c #000000",