move default window menu to ~/.fluxbox/windowmenu
This commit is contained in:
parent
e71892d99c
commit
1a54fbc67d
10 changed files with 53 additions and 51 deletions
|
@ -1,5 +1,8 @@
|
||||||
(Format: Year/Month/Day)
|
(Format: Year/Month/Day)
|
||||||
Changes for 1.1
|
Changes for 1.1
|
||||||
|
*08/06/20:
|
||||||
|
* Move default window menu to ~/.fluxbox/windowmenu (Mark)
|
||||||
|
configure.in data/Makefile.am data/windowmenu Screen.cc
|
||||||
*08/06/08:
|
*08/06/08:
|
||||||
* Add (urgent=yes|no) option to client patterns (Mark)
|
* Add (urgent=yes|no) option to client patterns (Mark)
|
||||||
ClientPattern.cc/hh
|
ClientPattern.cc/hh
|
||||||
|
|
|
@ -537,6 +537,14 @@ AC_ARG_WITH(
|
||||||
)
|
)
|
||||||
AC_SUBST(DEFAULT_MENU)
|
AC_SUBST(DEFAULT_MENU)
|
||||||
|
|
||||||
|
AC_ARG_WITH(
|
||||||
|
windowmenu,
|
||||||
|
[ --with-windowmenu=path location windowmenu file (PREFIX/share/fluxbox/windowmenu)],
|
||||||
|
DEFAULT_WINDOWMENU=$with_windowmenu,
|
||||||
|
DEFAULT_WINDOWMENU=\$\(prefix\)/share/fluxbox/windowmenu
|
||||||
|
)
|
||||||
|
AC_SUBST(DEFAULT_WINDOWMENU)
|
||||||
|
|
||||||
AC_ARG_WITH(
|
AC_ARG_WITH(
|
||||||
style,
|
style,
|
||||||
[ --with-style=path style by default (PREFIX/share/fluxbox/styles/bloe)],
|
[ --with-style=path style by default (PREFIX/share/fluxbox/styles/bloe)],
|
||||||
|
|
|
@ -9,6 +9,7 @@ DEFAULT_KEYS = @DEFAULT_KEYS@
|
||||||
DEFAULT_APPS = @DEFAULT_APPS@
|
DEFAULT_APPS = @DEFAULT_APPS@
|
||||||
DEFAULT_OVERLAY = @DEFAULT_OVERLAY@
|
DEFAULT_OVERLAY = @DEFAULT_OVERLAY@
|
||||||
DEFAULT_INIT = @DEFAULT_INIT@
|
DEFAULT_INIT = @DEFAULT_INIT@
|
||||||
|
DEFAULT_WINDOWMENU = @DEFAULT_WINDOWMENU@
|
||||||
|
|
||||||
SUBDIRS= styles
|
SUBDIRS= styles
|
||||||
CLEANFILES= menu menu.in menu.pre menu.bak init apps
|
CLEANFILES= menu menu.in menu.pre menu.bak init apps
|
||||||
|
@ -19,7 +20,7 @@ all-local: menu init apps
|
||||||
install-pkgdataDATA:
|
install-pkgdataDATA:
|
||||||
@echo "Installing menu file in $(DESTDIR)$(DEFAULT_MENU)"
|
@echo "Installing menu file in $(DESTDIR)$(DEFAULT_MENU)"
|
||||||
$(mkinstalldirs) $(DESTDIR)$(dir $(DEFAULT_MENU))
|
$(mkinstalldirs) $(DESTDIR)$(dir $(DEFAULT_MENU))
|
||||||
$(INSTALL_DATA) menu $(DESTDIR)$(DEFAULT_MENU)
|
$(INSTALL_DATA) $(srcdir)/menu $(DESTDIR)$(DEFAULT_MENU)
|
||||||
@echo "Installing keys file in $(DESTDIR)$(DEFAULT_KEYS)"
|
@echo "Installing keys file in $(DESTDIR)$(DEFAULT_KEYS)"
|
||||||
$(mkinstalldirs) $(DESTDIR)$(dir $(DEFAULT_KEYS))
|
$(mkinstalldirs) $(DESTDIR)$(dir $(DEFAULT_KEYS))
|
||||||
$(INSTALL_DATA) $(srcdir)/keys $(DESTDIR)$(DEFAULT_KEYS)
|
$(INSTALL_DATA) $(srcdir)/keys $(DESTDIR)$(DEFAULT_KEYS)
|
||||||
|
@ -31,7 +32,10 @@ install-pkgdataDATA:
|
||||||
$(INSTALL_DATA) $(srcdir)/overlay $(DESTDIR)$(DEFAULT_OVERLAY)
|
$(INSTALL_DATA) $(srcdir)/overlay $(DESTDIR)$(DEFAULT_OVERLAY)
|
||||||
@echo "Installing init file in $(DESTDIR)$(DEFAULT_INIT)"
|
@echo "Installing init file in $(DESTDIR)$(DEFAULT_INIT)"
|
||||||
$(mkinstalldirs) $(DESTDIR)$(dir $(DEFAULT_INIT))
|
$(mkinstalldirs) $(DESTDIR)$(dir $(DEFAULT_INIT))
|
||||||
$(INSTALL_DATA) init $(DESTDIR)$(DEFAULT_INIT)
|
$(INSTALL_DATA) $(srcdir)/init $(DESTDIR)$(DEFAULT_INIT)
|
||||||
|
@echo "Installing windowmenu file in $(DESTDIR)$(DEFAULT_WINDOWMENU)"
|
||||||
|
$(mkinstalldirs) $(DESTDIR)$(dir $(DEFAULT_WINDOWMENU))
|
||||||
|
$(INSTALL_DATA) $(srcdir)/windowmenu $(DESTDIR)$(DEFAULT_WINDOWMENU)
|
||||||
|
|
||||||
distclean-local:
|
distclean-local:
|
||||||
rm -f *\~
|
rm -f *\~
|
||||||
|
|
|
@ -30,6 +30,7 @@ DEFAULT_KEYSFILE=@DEFAULT_KEYS@
|
||||||
DEFAULT_APPSFILE=@DEFAULT_APPS@
|
DEFAULT_APPSFILE=@DEFAULT_APPS@
|
||||||
DEFAULT_OVERLAY=@DEFAULT_OVERLAY@
|
DEFAULT_OVERLAY=@DEFAULT_OVERLAY@
|
||||||
DEFAULT_INITFILE=@DEFAULT_INIT@
|
DEFAULT_INITFILE=@DEFAULT_INIT@
|
||||||
|
DEFAULT_WINDOWMENU=@DEFAULT_WINDOWMENU@
|
||||||
PROGRAM_PREFIX=@program_prefix@
|
PROGRAM_PREFIX=@program_prefix@
|
||||||
PROGRAM_SUFFIX=@program_suffix@
|
PROGRAM_SUFFIX=@program_suffix@
|
||||||
|
|
||||||
|
@ -49,6 +50,7 @@ defaults.hh: Makefile
|
||||||
echo '#define DEFAULT_APPSFILE "$(DEFAULT_APPSFILE)"'; \
|
echo '#define DEFAULT_APPSFILE "$(DEFAULT_APPSFILE)"'; \
|
||||||
echo '#define DEFAULT_OVERLAY "$(DEFAULT_OVERLAY)"'; \
|
echo '#define DEFAULT_OVERLAY "$(DEFAULT_OVERLAY)"'; \
|
||||||
echo '#define DEFAULT_INITFILE "$(DEFAULT_INITFILE)"'; \
|
echo '#define DEFAULT_INITFILE "$(DEFAULT_INITFILE)"'; \
|
||||||
|
echo '#define DEFAULT_WINDOWMENU "$(DEFAULT_WINDOWMENU)"'; \
|
||||||
echo '#define PROGRAM_PREFIX "$(PROGRAM_PREFIX:NONE=)"'; \
|
echo '#define PROGRAM_PREFIX "$(PROGRAM_PREFIX:NONE=)"'; \
|
||||||
echo '#define PROGRAM_SUFFIX "$(PROGRAM_SUFFIX:NONE=)"'; \
|
echo '#define PROGRAM_SUFFIX "$(PROGRAM_SUFFIX:NONE=)"'; \
|
||||||
echo 'std::string realProgramName(std::string name);'; \
|
echo 'std::string realProgramName(std::string name);'; \
|
||||||
|
|
|
@ -278,7 +278,7 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm,
|
||||||
default_deco(rm, "NORMAL", scrname+".defaultDeco", altscrname+".DefaultDeco"),
|
default_deco(rm, "NORMAL", scrname+".defaultDeco", altscrname+".DefaultDeco"),
|
||||||
rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"),
|
rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"),
|
||||||
tab_placement(rm, FbWinFrame::TOPLEFT, scrname+".tab.placement", altscrname+".Tab.Placement"),
|
tab_placement(rm, FbWinFrame::TOPLEFT, scrname+".tab.placement", altscrname+".Tab.Placement"),
|
||||||
windowmenufile(rm, "", scrname+".windowMenu", altscrname+".WindowMenu"),
|
windowmenufile(rm, Fluxbox::instance()->getDefaultDataFilename("windowmenu"), scrname+".windowMenu", altscrname+".WindowMenu"),
|
||||||
typing_delay(rm, 0, scrname+".noFocusWhileTypingDelay", altscrname+".NoFocusWhileTypingDelay"),
|
typing_delay(rm, 0, scrname+".noFocusWhileTypingDelay", altscrname+".NoFocusWhileTypingDelay"),
|
||||||
follow_model(rm, IGNORE_OTHER_WORKSPACES, scrname+".followModel", altscrname+".followModel"),
|
follow_model(rm, IGNORE_OTHER_WORKSPACES, scrname+".followModel", altscrname+".followModel"),
|
||||||
user_follow_model(rm, FOLLOW_ACTIVE_WINDOW, scrname+".userFollowModel", altscrname+".UserFollowModel"),
|
user_follow_model(rm, FOLLOW_ACTIVE_WINDOW, scrname+".userFollowModel", altscrname+".UserFollowModel"),
|
||||||
|
@ -1523,6 +1523,12 @@ void BScreen::rereadMenu() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::string BScreen::windowMenuFilename() const {
|
||||||
|
if ((*resource.windowmenufile).empty())
|
||||||
|
return Fluxbox::instance()->getDefaultDataFilename("windowmenu");
|
||||||
|
return *resource.windowmenufile;
|
||||||
|
}
|
||||||
|
|
||||||
void BScreen::rereadWindowMenu() {
|
void BScreen::rereadWindowMenu() {
|
||||||
|
|
||||||
m_windowmenu->removeAll();
|
m_windowmenu->removeAll();
|
||||||
|
@ -1530,26 +1536,6 @@ void BScreen::rereadWindowMenu() {
|
||||||
MenuCreator::createFromFile(windowMenuFilename(), *m_windowmenu,
|
MenuCreator::createFromFile(windowMenuFilename(), *m_windowmenu,
|
||||||
m_windowmenu->reloadHelper());
|
m_windowmenu->reloadHelper());
|
||||||
|
|
||||||
if (m_windowmenu->numberOfItems() == 0) {
|
|
||||||
const char *defaults[] = {
|
|
||||||
"shade",
|
|
||||||
"stick",
|
|
||||||
"maximize",
|
|
||||||
"iconify",
|
|
||||||
"raise",
|
|
||||||
"lower",
|
|
||||||
"sendto",
|
|
||||||
"layer",
|
|
||||||
"alpha",
|
|
||||||
"extramenus",
|
|
||||||
"separator",
|
|
||||||
"close",
|
|
||||||
0
|
|
||||||
};
|
|
||||||
for (unsigned int i=0; defaults[i]; ++i)
|
|
||||||
MenuCreator::createWindowMenuItem(defaults[i], "", *m_windowmenu);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BScreen::addConfigMenu(const FbTk::FbString &label, FbTk::Menu &menu) {
|
void BScreen::addConfigMenu(const FbTk::FbString &label, FbTk::Menu &menu) {
|
||||||
|
|
|
@ -120,7 +120,7 @@ public:
|
||||||
bool doShowWindowPos() const { return *resource.show_window_pos; }
|
bool doShowWindowPos() const { return *resource.show_window_pos; }
|
||||||
bool decorateTransient() const { return *resource.decorate_transient; }
|
bool decorateTransient() const { return *resource.decorate_transient; }
|
||||||
const std::string &defaultDeco() const { return *resource.default_deco; }
|
const std::string &defaultDeco() const { return *resource.default_deco; }
|
||||||
const std::string &windowMenuFilename() const { return *resource.windowmenufile; }
|
const std::string windowMenuFilename() const;
|
||||||
FbTk::ImageControl &imageControl() { return *m_image_control.get(); }
|
FbTk::ImageControl &imageControl() { return *m_image_control.get(); }
|
||||||
// menus
|
// menus
|
||||||
const FbMenu &rootMenu() const { return *m_rootmenu.get(); }
|
const FbMenu &rootMenu() const { return *m_rootmenu.get(); }
|
||||||
|
|
|
@ -2154,11 +2154,11 @@ void FluxboxWindow::restoreAttributes() {
|
||||||
Show the window menu at pos mx, my
|
Show the window menu at pos mx, my
|
||||||
*/
|
*/
|
||||||
void FluxboxWindow::showMenu(int menu_x, int menu_y) {
|
void FluxboxWindow::showMenu(int menu_x, int menu_y) {
|
||||||
// move menu directly under titlebar
|
menu().reloadHelper()->checkReload();
|
||||||
|
|
||||||
int head = screen().getHead(menu_x, menu_y);
|
int head = screen().getHead(menu_x, menu_y);
|
||||||
|
|
||||||
// but not off the screen
|
// move menu directly under titlebar but not off the screen
|
||||||
if (menu_y < static_cast<signed>(screen().maxTop(head)))
|
if (menu_y < static_cast<signed>(screen().maxTop(head)))
|
||||||
menu_y = screen().maxTop(head);
|
menu_y = screen().maxTop(head);
|
||||||
else if (menu_y + menu().height() >= screen().maxBottom(head))
|
else if (menu_y + menu().height() >= screen().maxBottom(head))
|
||||||
|
@ -3648,7 +3648,7 @@ const FbTk::FbWindow &FluxboxWindow::fbWindow() const {
|
||||||
return frame().window();
|
return frame().window();
|
||||||
}
|
}
|
||||||
|
|
||||||
FbTk::Menu &FluxboxWindow::menu() {
|
FbMenu &FluxboxWindow::menu() {
|
||||||
return screen().windowMenu();
|
return screen().windowMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3660,7 +3660,7 @@ const FbTk::PixmapWithMask &FluxboxWindow::icon() const {
|
||||||
return (m_client ? m_client->icon() : m_icon);
|
return (m_client ? m_client->icon() : m_icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
const FbTk::Menu &FluxboxWindow::menu() const {
|
const FbMenu &FluxboxWindow::menu() const {
|
||||||
return screen().windowMenu();
|
return screen().windowMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,13 +47,13 @@ class FbWinFrameTheme;
|
||||||
class BScreen;
|
class BScreen;
|
||||||
class FbWinFrame;
|
class FbWinFrame;
|
||||||
class FocusControl;
|
class FocusControl;
|
||||||
|
class FbMenu;
|
||||||
|
|
||||||
namespace FbTk {
|
namespace FbTk {
|
||||||
class TextButton;
|
class TextButton;
|
||||||
class MenuTheme;
|
class MenuTheme;
|
||||||
class ImageControl;
|
class ImageControl;
|
||||||
class XLayer;
|
class XLayer;
|
||||||
class Menu;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates the window frame and handles any window event for it
|
/// Creates the window frame and handles any window event for it
|
||||||
|
@ -439,8 +439,8 @@ public:
|
||||||
FbTk::FbWindow &fbWindow();
|
FbTk::FbWindow &fbWindow();
|
||||||
const FbTk::FbWindow &fbWindow() const;
|
const FbTk::FbWindow &fbWindow() const;
|
||||||
|
|
||||||
FbTk::Menu &menu();
|
FbMenu &menu();
|
||||||
const FbTk::Menu &menu() const;
|
const FbMenu &menu() const;
|
||||||
|
|
||||||
const FbTk::FbWindow &parent() const { return m_parent; }
|
const FbTk::FbWindow &parent() const { return m_parent; }
|
||||||
FbTk::FbWindow &parent() { return m_parent; }
|
FbTk::FbWindow &parent() { return m_parent; }
|
||||||
|
|
|
@ -522,16 +522,15 @@ void Fluxbox::ungrab() {
|
||||||
void Fluxbox::setupConfigFiles() {
|
void Fluxbox::setupConfigFiles() {
|
||||||
|
|
||||||
bool create_init = false, create_keys = false, create_menu = false,
|
bool create_init = false, create_keys = false, create_menu = false,
|
||||||
create_apps = false, create_overlay = false;
|
create_apps = false, create_overlay = false, create_windowmenu = false;
|
||||||
|
|
||||||
string dirname = getenv("HOME") + string("/.") + m_RC_PATH + "/";
|
string dirname = getDefaultDataFilename("");
|
||||||
string init_file, keys_file, menu_file, slitlist_file, apps_file,
|
string init_file = getDefaultDataFilename(m_RC_INIT_FILE);
|
||||||
overlay_file;
|
string keys_file = getDefaultDataFilename("keys");
|
||||||
init_file = dirname + m_RC_INIT_FILE;
|
string menu_file = getDefaultDataFilename("menu");
|
||||||
keys_file = dirname + "keys";
|
string apps_file = getDefaultDataFilename("apps");
|
||||||
menu_file = dirname + "menu";
|
string overlay_file = getDefaultDataFilename("overlay");
|
||||||
apps_file = dirname + "apps";
|
string windowmenu_file = getDefaultDataFilename("windowmenu");
|
||||||
overlay_file = dirname + "overlay";
|
|
||||||
|
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
|
|
||||||
|
@ -549,6 +548,8 @@ void Fluxbox::setupConfigFiles() {
|
||||||
create_apps = true;
|
create_apps = true;
|
||||||
if (stat(overlay_file.c_str(), &buf))
|
if (stat(overlay_file.c_str(), &buf))
|
||||||
create_overlay = true;
|
create_overlay = true;
|
||||||
|
if (stat(windowmenu_file.c_str(), &buf))
|
||||||
|
create_windowmenu = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -590,6 +591,9 @@ void Fluxbox::setupConfigFiles() {
|
||||||
if (create_init)
|
if (create_init)
|
||||||
FbTk::FileUtil::copyFile(DEFAULT_INITFILE, init_file.c_str());
|
FbTk::FileUtil::copyFile(DEFAULT_INITFILE, init_file.c_str());
|
||||||
|
|
||||||
|
if (create_windowmenu)
|
||||||
|
FbTk::FileUtil::copyFile(DEFAULT_WINDOWMENU, windowmenu_file.c_str());
|
||||||
|
|
||||||
#define CONFIG_VERSION 8
|
#define CONFIG_VERSION 8
|
||||||
FbTk::Resource<int> config_version(m_resourcemanager, 0,
|
FbTk::Resource<int> config_version(m_resourcemanager, 0,
|
||||||
"session.configVersion", "Session.ConfigVersion");
|
"session.configVersion", "Session.ConfigVersion");
|
||||||
|
@ -1319,18 +1323,14 @@ void Fluxbox::save_rc() {
|
||||||
|
|
||||||
/// @return filename of resource file
|
/// @return filename of resource file
|
||||||
string Fluxbox::getRcFilename() {
|
string Fluxbox::getRcFilename() {
|
||||||
|
if (m_rc_file.empty())
|
||||||
if (m_rc_file.empty()) { // set default filename
|
return getDefaultDataFilename(m_RC_INIT_FILE);
|
||||||
string defaultfile(getenv("HOME") + string("/.") + m_RC_PATH + string("/") + m_RC_INIT_FILE);
|
|
||||||
return defaultfile;
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_rc_file;
|
return m_rc_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Provides default filename of data file
|
/// Provides default filename of data file
|
||||||
void Fluxbox::getDefaultDataFilename(const char *name, string &filename) const {
|
string Fluxbox::getDefaultDataFilename(const char *name) const {
|
||||||
filename = string(getenv("HOME") + string("/.") + m_RC_PATH + string("/") + name);
|
return (getenv("HOME") + string("/.") + m_RC_PATH + string("/") + name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// loads resources
|
/// loads resources
|
||||||
|
@ -1359,8 +1359,7 @@ void Fluxbox::load_rc() {
|
||||||
if (!m_rc_slitlistfile->empty()) {
|
if (!m_rc_slitlistfile->empty()) {
|
||||||
*m_rc_slitlistfile = StringUtil::expandFilename(*m_rc_slitlistfile);
|
*m_rc_slitlistfile = StringUtil::expandFilename(*m_rc_slitlistfile);
|
||||||
} else {
|
} else {
|
||||||
string filename;
|
string filename = getDefaultDataFilename("slitlist");
|
||||||
getDefaultDataFilename("slitlist", filename);
|
|
||||||
m_rc_slitlistfile.setFromString(filename.c_str());
|
m_rc_slitlistfile.setFromString(filename.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -175,7 +175,7 @@ public:
|
||||||
|
|
||||||
bool haveShape() const { return m_have_shape; }
|
bool haveShape() const { return m_have_shape; }
|
||||||
int shapeEventbase() const { return m_shape_eventbase; }
|
int shapeEventbase() const { return m_shape_eventbase; }
|
||||||
void getDefaultDataFilename(const char *name, std::string &) const;
|
std::string getDefaultDataFilename(const char *name) const;
|
||||||
// screen mouse was in at last key event
|
// screen mouse was in at last key event
|
||||||
BScreen *mouseScreen() { return m_mousescreen; }
|
BScreen *mouseScreen() { return m_mousescreen; }
|
||||||
// screen of window that last key event (i.e. focused window) went to
|
// screen of window that last key event (i.e. focused window) went to
|
||||||
|
|
Loading…
Reference in a new issue