add a xinerama support menu
This commit is contained in:
parent
ccecab7915
commit
da67802bc8
3 changed files with 114 additions and 11 deletions
|
@ -38,11 +38,18 @@ Configmenu::Configmenu(BScreen *scr) : Basemenu(scr) {
|
||||||
|
|
||||||
focusmenu = new Focusmenu(this);
|
focusmenu = new Focusmenu(this);
|
||||||
placementmenu = new Placementmenu(this);
|
placementmenu = new Placementmenu(this);
|
||||||
|
#ifdef XINERAMA
|
||||||
|
xineramamenu = new Xineramamenu(this);
|
||||||
|
#endif // XINERAMA
|
||||||
|
|
||||||
insert(i18n(ConfigmenuSet, ConfigmenuFocusModel,
|
insert(i18n(ConfigmenuSet, ConfigmenuFocusModel,
|
||||||
"Focus Model"), focusmenu);
|
"Focus Model"), focusmenu);
|
||||||
insert(i18n(ConfigmenuSet, ConfigmenuWindowPlacement,
|
insert(i18n(ConfigmenuSet, ConfigmenuWindowPlacement,
|
||||||
"Window Placement"), placementmenu);
|
"Window Placement"), placementmenu);
|
||||||
|
#ifdef XINERAMA
|
||||||
|
insert(i18n(ConfigmenuSet, ConfigmenuXineramaSupport,
|
||||||
|
"XineramaSupport"), xineramamenu);
|
||||||
|
#endif // XINERAMA
|
||||||
insert(i18n(ConfigmenuSet, ConfigmenuImageDithering,
|
insert(i18n(ConfigmenuSet, ConfigmenuImageDithering,
|
||||||
"Image Dithering"), 1);
|
"Image Dithering"), 1);
|
||||||
insert(i18n(ConfigmenuSet, ConfigmenuOpaqueMove,
|
insert(i18n(ConfigmenuSet, ConfigmenuOpaqueMove,
|
||||||
|
@ -67,24 +74,27 @@ Configmenu::Configmenu(BScreen *scr) : Basemenu(scr) {
|
||||||
|
|
||||||
|
|
||||||
void Configmenu::setValues(void) {
|
void Configmenu::setValues(void) {
|
||||||
setItemSelected(2, getScreen()->doImageDither());
|
setItemSelected(3, getScreen()->doImageDither());
|
||||||
setItemSelected(3, getScreen()->doOpaqueMove());
|
setItemSelected(4, getScreen()->doOpaqueMove());
|
||||||
setItemSelected(4, getScreen()->doFullMax());
|
setItemSelected(5, getScreen()->doFullMax());
|
||||||
setItemSelected(5, getScreen()->doFocusNew());
|
setItemSelected(6, getScreen()->doFocusNew());
|
||||||
setItemSelected(6, getScreen()->doFocusLast());
|
setItemSelected(7, getScreen()->doFocusLast());
|
||||||
setItemSelected(7, getScreen()->getWindowToWindowSnap());
|
setItemSelected(8, getScreen()->getWindowToWindowSnap());
|
||||||
|
|
||||||
setItemSelected(8, getScreen()->getWindowCornerSnap());
|
setItemSelected(9, getScreen()->getWindowCornerSnap());
|
||||||
setItemEnabled(8, getScreen()->getWindowToWindowSnap());
|
setItemEnabled(9, getScreen()->getWindowToWindowSnap());
|
||||||
|
|
||||||
setItemSelected(9, getScreen()->allowScrollLock());
|
setItemSelected(10, getScreen()->allowScrollLock());
|
||||||
setItemSelected(10, getScreen()->doHideToolbar());
|
setItemSelected(11, getScreen()->doHideToolbar());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Configmenu::~Configmenu(void) {
|
Configmenu::~Configmenu(void) {
|
||||||
delete focusmenu;
|
delete focusmenu;
|
||||||
delete placementmenu;
|
delete placementmenu;
|
||||||
|
#ifdef XINERAMA
|
||||||
|
delete xineramamenu;
|
||||||
|
#endif // XINERAMA
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -152,6 +162,7 @@ void Configmenu::reconfigure(void) {
|
||||||
setValues();
|
setValues();
|
||||||
focusmenu->reconfigure();
|
focusmenu->reconfigure();
|
||||||
placementmenu->reconfigure();
|
placementmenu->reconfigure();
|
||||||
|
xineramamenu->reconfigure();
|
||||||
|
|
||||||
Basemenu::reconfigure();
|
Basemenu::reconfigure();
|
||||||
}
|
}
|
||||||
|
@ -418,3 +429,65 @@ void Configmenu::Placementmenu::itemSelected(int button, unsigned int index) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef XINERAMA
|
||||||
|
Configmenu::Xineramamenu::Xineramamenu(Configmenu *cm):
|
||||||
|
Basemenu(cm->getScreen()) {
|
||||||
|
setLabel(i18n(ConfigmenuSet, ConfigmenuXineramaSupport, "Xinerama Support"));
|
||||||
|
setInternalMenu();
|
||||||
|
|
||||||
|
insert(i18n(ConfigmenuSet, ConfigmenuXineramaPlacement, "Window Placement"),
|
||||||
|
1);
|
||||||
|
insert(i18n(ConfigmenuSet, ConfigmenuXineramaMaximizing, "Window Maximizing"),
|
||||||
|
2);
|
||||||
|
insert(i18n(ConfigmenuSet, ConfigmenuXineramaSnapping, "Window Snapping"),
|
||||||
|
3);
|
||||||
|
|
||||||
|
update();
|
||||||
|
setValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Configmenu::Xineramamenu::setValues(void) {
|
||||||
|
setItemSelected(0, getScreen()->getBlackbox()->doXineramaPlacement());
|
||||||
|
setItemSelected(1, getScreen()->getBlackbox()->doXineramaMaximizing());
|
||||||
|
setItemSelected(2, getScreen()->getBlackbox()->doXineramaSnapping());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Configmenu::Xineramamenu::reconfigure(void) {
|
||||||
|
setValues();
|
||||||
|
Basemenu::reconfigure();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Configmenu::Xineramamenu::itemSelected(int button, unsigned int index) {
|
||||||
|
if (button != 1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
BasemenuItem *item = find(index);
|
||||||
|
|
||||||
|
if (! item->function())
|
||||||
|
return;
|
||||||
|
|
||||||
|
Blackbox *bb = getScreen()->getBlackbox();
|
||||||
|
|
||||||
|
switch (item->function()) {
|
||||||
|
case 1: // window placement
|
||||||
|
bb->saveXineramaPlacement(! bb->doXineramaPlacement());
|
||||||
|
setItemSelected(0, bb->doXineramaPlacement());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2: // window maximizing
|
||||||
|
bb->saveXineramaMaximizing(! bb->doXineramaMaximizing());
|
||||||
|
setItemSelected(1, bb->doXineramaMaximizing());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3: // window snapping
|
||||||
|
bb->saveXineramaSnapping(! bb->doXineramaSnapping());
|
||||||
|
setItemSelected(2, bb->doXineramaSnapping());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // XINERAMA
|
||||||
|
|
|
@ -61,8 +61,27 @@ private:
|
||||||
virtual void reconfigure(void);
|
virtual void reconfigure(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef XINERAMA
|
||||||
|
class Xineramamenu : public Basemenu {
|
||||||
|
private:
|
||||||
|
Xineramamenu(const Xineramamenu&);
|
||||||
|
Xineramamenu& operator=(const Xineramamenu&);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void itemSelected(int button, unsigned int index);
|
||||||
|
virtual void setValues(void);
|
||||||
|
|
||||||
|
public:
|
||||||
|
Xineramamenu(Configmenu *cm);
|
||||||
|
virtual void reconfigure(void);
|
||||||
|
};
|
||||||
|
#endif // XINERAMA
|
||||||
|
|
||||||
Focusmenu *focusmenu;
|
Focusmenu *focusmenu;
|
||||||
Placementmenu *placementmenu;
|
Placementmenu *placementmenu;
|
||||||
|
#ifdef XINERAMA
|
||||||
|
Xineramamenu *xineramamenu;
|
||||||
|
#endif // XINERAMA
|
||||||
|
|
||||||
friend class Focusmenu;
|
friend class Focusmenu;
|
||||||
friend class Placementmenu;
|
friend class Placementmenu;
|
||||||
|
@ -80,6 +99,9 @@ public:
|
||||||
|
|
||||||
inline Basemenu *getFocusmenu(void) { return focusmenu; }
|
inline Basemenu *getFocusmenu(void) { return focusmenu; }
|
||||||
inline Basemenu *getPlacementmenu(void) { return placementmenu; }
|
inline Basemenu *getPlacementmenu(void) { return placementmenu; }
|
||||||
|
#ifdef XINERAMA
|
||||||
|
inline Basemenu *getXineramamenu(void) { return xineramamenu; }
|
||||||
|
#endif // XINERAMA
|
||||||
|
|
||||||
virtual void reconfigure(void);
|
virtual void reconfigure(void);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1399,8 +1399,13 @@ void BScreen::updateNetizenConfigNotify(XEvent *e) {
|
||||||
|
|
||||||
void BScreen::raiseWindows(Window *workspace_stack, unsigned int num) {
|
void BScreen::raiseWindows(Window *workspace_stack, unsigned int num) {
|
||||||
// the 13 represents the number of blackbox windows such as menus
|
// the 13 represents the number of blackbox windows such as menus
|
||||||
|
int bbwins = 13;
|
||||||
|
#ifdef XINERAMA
|
||||||
|
++bbwins;
|
||||||
|
#endif // XINERAMA
|
||||||
|
|
||||||
Window *session_stack = new
|
Window *session_stack = new
|
||||||
Window[(num + workspacesList.size() + rootmenuList.size() + 13)];
|
Window[(num + workspacesList.size() + rootmenuList.size() + bbwins)];
|
||||||
unsigned int i = 0, k = num;
|
unsigned int i = 0, k = num;
|
||||||
|
|
||||||
XRaiseWindow(blackbox->getXDisplay(), iconmenu->getWindowID());
|
XRaiseWindow(blackbox->getXDisplay(), iconmenu->getWindowID());
|
||||||
|
@ -1415,6 +1420,9 @@ void BScreen::raiseWindows(Window *workspace_stack, unsigned int num) {
|
||||||
|
|
||||||
*(session_stack + i++) = configmenu->getFocusmenu()->getWindowID();
|
*(session_stack + i++) = configmenu->getFocusmenu()->getWindowID();
|
||||||
*(session_stack + i++) = configmenu->getPlacementmenu()->getWindowID();
|
*(session_stack + i++) = configmenu->getPlacementmenu()->getWindowID();
|
||||||
|
#ifdef XINERAMA
|
||||||
|
*(session_stack + i++) = configmenu->getXineramamenu()->getWindowID();
|
||||||
|
#endif // XINERAMA
|
||||||
*(session_stack + i++) = configmenu->getWindowID();
|
*(session_stack + i++) = configmenu->getWindowID();
|
||||||
|
|
||||||
*(session_stack + i++) = slit->getMenu()->getDirectionmenu()->getWindowID();
|
*(session_stack + i++) = slit->getMenu()->getDirectionmenu()->getWindowID();
|
||||||
|
|
Loading…
Reference in a new issue