add a xinerama support menu

This commit is contained in:
Dana Jansens 2002-07-22 08:09:34 +00:00
parent ccecab7915
commit da67802bc8
3 changed files with 114 additions and 11 deletions

View file

@ -38,11 +38,18 @@ Configmenu::Configmenu(BScreen *scr) : Basemenu(scr) {
focusmenu = new Focusmenu(this);
placementmenu = new Placementmenu(this);
#ifdef XINERAMA
xineramamenu = new Xineramamenu(this);
#endif // XINERAMA
insert(i18n(ConfigmenuSet, ConfigmenuFocusModel,
"Focus Model"), focusmenu);
insert(i18n(ConfigmenuSet, ConfigmenuWindowPlacement,
"Window Placement"), placementmenu);
#ifdef XINERAMA
insert(i18n(ConfigmenuSet, ConfigmenuXineramaSupport,
"XineramaSupport"), xineramamenu);
#endif // XINERAMA
insert(i18n(ConfigmenuSet, ConfigmenuImageDithering,
"Image Dithering"), 1);
insert(i18n(ConfigmenuSet, ConfigmenuOpaqueMove,
@ -67,24 +74,27 @@ Configmenu::Configmenu(BScreen *scr) : Basemenu(scr) {
void Configmenu::setValues(void) {
setItemSelected(2, getScreen()->doImageDither());
setItemSelected(3, getScreen()->doOpaqueMove());
setItemSelected(4, getScreen()->doFullMax());
setItemSelected(5, getScreen()->doFocusNew());
setItemSelected(6, getScreen()->doFocusLast());
setItemSelected(7, getScreen()->getWindowToWindowSnap());
setItemSelected(3, getScreen()->doImageDither());
setItemSelected(4, getScreen()->doOpaqueMove());
setItemSelected(5, getScreen()->doFullMax());
setItemSelected(6, getScreen()->doFocusNew());
setItemSelected(7, getScreen()->doFocusLast());
setItemSelected(8, getScreen()->getWindowToWindowSnap());
setItemSelected(8, getScreen()->getWindowCornerSnap());
setItemEnabled(8, getScreen()->getWindowToWindowSnap());
setItemSelected(9, getScreen()->getWindowCornerSnap());
setItemEnabled(9, getScreen()->getWindowToWindowSnap());
setItemSelected(9, getScreen()->allowScrollLock());
setItemSelected(10, getScreen()->doHideToolbar());
setItemSelected(10, getScreen()->allowScrollLock());
setItemSelected(11, getScreen()->doHideToolbar());
}
Configmenu::~Configmenu(void) {
delete focusmenu;
delete placementmenu;
#ifdef XINERAMA
delete xineramamenu;
#endif // XINERAMA
}
@ -152,6 +162,7 @@ void Configmenu::reconfigure(void) {
setValues();
focusmenu->reconfigure();
placementmenu->reconfigure();
xineramamenu->reconfigure();
Basemenu::reconfigure();
}
@ -418,3 +429,65 @@ void Configmenu::Placementmenu::itemSelected(int button, unsigned int index) {
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

View file

@ -61,8 +61,27 @@ private:
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;
Placementmenu *placementmenu;
#ifdef XINERAMA
Xineramamenu *xineramamenu;
#endif // XINERAMA
friend class Focusmenu;
friend class Placementmenu;
@ -80,6 +99,9 @@ public:
inline Basemenu *getFocusmenu(void) { return focusmenu; }
inline Basemenu *getPlacementmenu(void) { return placementmenu; }
#ifdef XINERAMA
inline Basemenu *getXineramamenu(void) { return xineramamenu; }
#endif // XINERAMA
virtual void reconfigure(void);
};

View file

@ -1399,8 +1399,13 @@ void BScreen::updateNetizenConfigNotify(XEvent *e) {
void BScreen::raiseWindows(Window *workspace_stack, unsigned int num) {
// the 13 represents the number of blackbox windows such as menus
int bbwins = 13;
#ifdef XINERAMA
++bbwins;
#endif // XINERAMA
Window *session_stack = new
Window[(num + workspacesList.size() + rootmenuList.size() + 13)];
Window[(num + workspacesList.size() + rootmenuList.size() + bbwins)];
unsigned int i = 0, k = num;
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->getPlacementmenu()->getWindowID();
#ifdef XINERAMA
*(session_stack + i++) = configmenu->getXineramamenu()->getWindowID();
#endif // XINERAMA
*(session_stack + i++) = configmenu->getWindowID();
*(session_stack + i++) = slit->getMenu()->getDirectionmenu()->getWindowID();