add some decorations to torn menus, and fix restart without an argument
This commit is contained in:
parent
363764db5b
commit
8da54ca0eb
6 changed files with 25 additions and 15 deletions
|
@ -1,5 +1,8 @@
|
||||||
(Format: Year/Month/Day)
|
(Format: Year/Month/Day)
|
||||||
Changes for 1.0.0:
|
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:
|
*07/07/24:
|
||||||
* Don't allow ToggleDecor with fullscreen windows, and make it show
|
* Don't allow ToggleDecor with fullscreen windows, and make it show
|
||||||
decorations for windows that don't have a titlebar by default (Mark)
|
decorations for windows that don't have a titlebar by default (Mark)
|
||||||
|
|
|
@ -310,8 +310,7 @@ void Ewmh::setupFrame(FluxboxWindow &win) {
|
||||||
} else if (atoms[l] == m_net_wm_window_type_dialog) {
|
} else if (atoms[l] == m_net_wm_window_type_dialog) {
|
||||||
// dialog windows should not be tabable
|
// dialog windows should not be tabable
|
||||||
win.setTabable(false);
|
win.setTabable(false);
|
||||||
} else if (atoms[l] == m_net_wm_window_type_menu ||
|
} else if (atoms[l] == m_net_wm_window_type_menu) {
|
||||||
atoms[l] == m_net_wm_window_type_toolbar) {
|
|
||||||
/*
|
/*
|
||||||
* _NET_WM_WINDOW_TYPE_TOOLBAR and _NET_WM_WINDOW_TYPE_MENU
|
* _NET_WM_WINDOW_TYPE_TOOLBAR and _NET_WM_WINDOW_TYPE_MENU
|
||||||
* indicate toolbar and pinnable menu windows, respectively
|
* indicate toolbar and pinnable menu windows, respectively
|
||||||
|
@ -319,6 +318,10 @@ void Ewmh::setupFrame(FluxboxWindow &win) {
|
||||||
* application). Windows of this type may set the
|
* application). Windows of this type may set the
|
||||||
* WM_TRANSIENT_FOR hint indicating the main application window.
|
* 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.setDecoration(FluxboxWindow::DECOR_NONE);
|
||||||
win.setIconHidden(true);
|
win.setIconHidden(true);
|
||||||
win.moveToLayer(Layer::ABOVE_DOCK);
|
win.moveToLayer(Layer::ABOVE_DOCK);
|
||||||
|
|
|
@ -115,7 +115,9 @@ const char *getFontElement(const char *pattern, char *buf, int bufsiz, ...) {
|
||||||
XFontSet createFontSet(const char *fontname, bool& utf8mode) {
|
XFontSet createFontSet(const char *fontname, bool& utf8mode) {
|
||||||
Display *display = FbTk::App::instance()->display();
|
Display *display = FbTk::App::instance()->display();
|
||||||
XFontSet fs;
|
XFontSet fs;
|
||||||
char **missing, *def = "-";
|
char **missing;
|
||||||
|
const char *constdef = "-";
|
||||||
|
char *def = const_cast<char *>(constdef);
|
||||||
int nmissing;
|
int nmissing;
|
||||||
string orig_locale = "";
|
string orig_locale = "";
|
||||||
|
|
||||||
|
|
16
src/main.cc
16
src/main.cc
|
@ -321,14 +321,16 @@ int main(int argc, char **argv) {
|
||||||
FbTk::FbStringUtil::shutdown();
|
FbTk::FbStringUtil::shutdown();
|
||||||
|
|
||||||
if (restarting) {
|
if (restarting) {
|
||||||
const char *shell = getenv("SHELL");
|
if (!restart_argument.empty()) {
|
||||||
if (!shell)
|
const char *shell = getenv("SHELL");
|
||||||
shell = "/bin/sh";
|
if (!shell)
|
||||||
|
shell = "/bin/sh";
|
||||||
|
|
||||||
const char *arg = restart_argument.c_str();
|
const char *arg = restart_argument.c_str();
|
||||||
if (arg) {
|
if (arg) {
|
||||||
execlp(shell, shell, "-c", arg, (char *) NULL);
|
execlp(shell, shell, "-c", arg, (const char *) NULL);
|
||||||
perror(arg);
|
perror(arg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// fall back in case the above execlp doesn't work
|
// fall back in case the above execlp doesn't work
|
||||||
|
|
|
@ -79,8 +79,8 @@ FbRun::FbRun(int x, int y, size_t width):
|
||||||
XClassHint *class_hint = XAllocClassHint();
|
XClassHint *class_hint = XAllocClassHint();
|
||||||
if (class_hint == 0)
|
if (class_hint == 0)
|
||||||
throw string("Out of memory");
|
throw string("Out of memory");
|
||||||
class_hint->res_name = "fbrun";
|
class_hint->res_name = const_cast<char *>("fbrun");
|
||||||
class_hint->res_class = "FbRun";
|
class_hint->res_class = const_cast<char *>("FbRun");
|
||||||
XSetClassHint(m_display, window(), class_hint);
|
XSetClassHint(m_display, window(), class_hint);
|
||||||
|
|
||||||
XFree(class_hint);
|
XFree(class_hint);
|
||||||
|
@ -89,7 +89,7 @@ FbRun::FbRun(int x, int y, size_t width):
|
||||||
Pixmap pm;
|
Pixmap pm;
|
||||||
XpmCreatePixmapFromData(m_display,
|
XpmCreatePixmapFromData(m_display,
|
||||||
window(),
|
window(),
|
||||||
fbrun_xpm,
|
const_cast<char **>(fbrun_xpm),
|
||||||
&pm,
|
&pm,
|
||||||
&mask,
|
&mask,
|
||||||
0); // attribs
|
0); // attribs
|
||||||
|
@ -120,7 +120,7 @@ void FbRun::run(const std::string &command) {
|
||||||
// fork and execute program
|
// fork and execute program
|
||||||
if (!fork()) {
|
if (!fork()) {
|
||||||
|
|
||||||
char *shell = getenv("SHELL");
|
const char *shell = getenv("SHELL");
|
||||||
if (!shell)
|
if (!shell)
|
||||||
shell = "/bin/sh";
|
shell = "/bin/sh";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* XPM */
|
/* XPM */
|
||||||
static char * fbrun_xpm[] = {
|
static const char * fbrun_xpm[] = {
|
||||||
"32 32 433 2",
|
"32 32 433 2",
|
||||||
" c None",
|
" c None",
|
||||||
". c #000000",
|
". c #000000",
|
||||||
|
|
Loading…
Reference in a new issue