add options for ignoring shaded windows and full-maxed windows while placing new windows
This commit is contained in:
parent
27fadda0d6
commit
5cf86b186c
5 changed files with 66 additions and 7 deletions
|
@ -46,3 +46,7 @@ $ #TopBottom
|
|||
# Top to Bottom
|
||||
$ #BottomTop
|
||||
# Bottom to Top
|
||||
$ #IgnoreShaded
|
||||
# Ignore shaded windows
|
||||
$ #IgnoreMax
|
||||
# Ignore full-maximized windows
|
||||
|
|
|
@ -229,6 +229,11 @@ Configmenu::Placementmenu::Placementmenu(Configmenu *cm):
|
|||
BScreen::TopBottom);
|
||||
insert(i18n(ConfigmenuSet, ConfigmenuBottomTop, "Bottom to Top"),
|
||||
BScreen::BottomTop);
|
||||
insert(i18n(ConfigmenuSet, ConfigmenuIgnoreShaded, "Ignore shaded windows"),
|
||||
BScreen::IgnoreShaded);
|
||||
insert(i18n(ConfigmenuSet, ConfigmenuIgnoreMax,
|
||||
"Ignore full-maximized windows"),
|
||||
BScreen::IgnoreMaximized);
|
||||
update();
|
||||
setValues();
|
||||
}
|
||||
|
@ -255,6 +260,9 @@ void Configmenu::Placementmenu::setValues(void) {
|
|||
setItemSelected(7, ! tb);
|
||||
setItemEnabled(6, e);
|
||||
setItemEnabled(7, e);
|
||||
|
||||
setItemSelected(8, getScreen()->getPlaceIgnoreShaded());
|
||||
setItemSelected(9, getScreen()->getPlaceIgnoreMaximized());
|
||||
}
|
||||
|
||||
|
||||
|
@ -360,6 +368,21 @@ void Configmenu::Placementmenu::itemSelected(int button, unsigned int index) {
|
|||
setItemSelected(6, false);
|
||||
setItemSelected(7, true);
|
||||
|
||||
break;
|
||||
|
||||
case BScreen::IgnoreShaded:
|
||||
getScreen()->savePlaceIgnoreShaded(! getScreen()->getPlaceIgnoreShaded());
|
||||
|
||||
setItemSelected(8, getScreen()->getPlaceIgnoreShaded());
|
||||
|
||||
break;
|
||||
|
||||
case BScreen::IgnoreMaximized:
|
||||
getScreen()->
|
||||
savePlaceIgnoreMaximized(! getScreen()->getPlaceIgnoreMaximized());
|
||||
|
||||
setItemSelected(9, getScreen()->getPlaceIgnoreMaximized());
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -490,7 +490,7 @@ void BScreen::saveDateFormat(int f) {
|
|||
}
|
||||
|
||||
|
||||
void BScreen::saveClock24Hour(Bool c) {
|
||||
void BScreen::saveClock24Hour(bool c) {
|
||||
resource.clock24hour = c;
|
||||
config->setValue(screenstr + "clockFormat", resource.clock24hour ? 24 : 12);
|
||||
}
|
||||
|
@ -510,6 +510,20 @@ void BScreen::saveWorkspaceNames() {
|
|||
}
|
||||
|
||||
|
||||
void BScreen::savePlaceIgnoreShaded(bool i) {
|
||||
resource.ignore_shaded = i;
|
||||
config->setValue(screenstr + "placementIgnoreShaded",
|
||||
resource.ignore_shaded);
|
||||
}
|
||||
|
||||
|
||||
void BScreen::savePlaceIgnoreMaximized(bool i) {
|
||||
resource.ignore_maximized = i;
|
||||
config->setValue(screenstr + "placementIgnoreMaximized",
|
||||
resource.ignore_maximized);
|
||||
}
|
||||
|
||||
|
||||
void BScreen::save_rc(void) {
|
||||
saveSloppyFocus(resource.sloppy_focus);
|
||||
saveAutoRaise(resource.auto_raise);
|
||||
|
@ -534,6 +548,8 @@ void BScreen::save_rc(void) {
|
|||
saveDateFormat(resource.date_format);
|
||||
savwClock24Hour(resource.clock24hour);
|
||||
#endif // HAVE_STRFTIME
|
||||
savePlaceIgnoreShaded(resource.ignore_shaded);
|
||||
savePlaceIgnoreMaximized(resource.ignore_maximized);
|
||||
|
||||
toolbar->save_rc();
|
||||
slit->save_rc();
|
||||
|
@ -639,9 +655,8 @@ void BScreen::load_rc(void) {
|
|||
resource.placement_policy = RowSmartPlacement;
|
||||
|
||||
#ifdef HAVE_STRFTIME
|
||||
if (config->getValue(screenstr + "strftimeFormat", s))
|
||||
resource.strftime_format = s;
|
||||
else
|
||||
if (! config->getValue(screenstr + "strftimeFormat",
|
||||
resource.strftime_format))
|
||||
resource.strftime_format = "%I:%M %p";
|
||||
#else // !HAVE_STRFTIME
|
||||
long l;
|
||||
|
@ -655,6 +670,14 @@ void BScreen::load_rc(void) {
|
|||
l = 12;
|
||||
resource.clock24hour = l == 24;
|
||||
#endif // HAVE_STRFTIME
|
||||
|
||||
if (! config->getValue(screenstr + "placementIgnoreShaded",
|
||||
resource.ignore_shaded))
|
||||
resource.ignore_shaded = true;
|
||||
|
||||
if (! config->getValue(screenstr + "placementIgnoreMaximized",
|
||||
resource.ignore_maximized))
|
||||
resource.ignore_maximized = true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -149,7 +149,8 @@ private:
|
|||
|
||||
bool sloppy_focus, auto_raise, auto_edge_balance, ordered_dither,
|
||||
opaque_move, full_max, focus_new, focus_last, click_raise,
|
||||
hide_toolbar, window_to_window_snap, window_corner_snap, aa_fonts;
|
||||
hide_toolbar, window_to_window_snap, window_corner_snap, aa_fonts,
|
||||
ignore_shaded, ignore_maximized;
|
||||
BColor border_color;
|
||||
|
||||
unsigned int workspaces;
|
||||
|
@ -189,7 +190,8 @@ private:
|
|||
void updateWorkArea(void);
|
||||
public:
|
||||
enum { RowSmartPlacement = 1, ColSmartPlacement, CascadePlacement,
|
||||
UnderMousePlacement, LeftRight, RightLeft, TopBottom, BottomTop };
|
||||
UnderMousePlacement, LeftRight, RightLeft, TopBottom, BottomTop,
|
||||
IgnoreShaded, IgnoreMaximized };
|
||||
enum { RoundBullet = 1, TriangleBullet, SquareBullet, NoBullet };
|
||||
enum { Restart = 1, RestartOther, Exit, Shutdown, Execute, Reconfigure,
|
||||
WindowShade, WindowIconify, WindowMaximize, WindowClose, WindowRaise,
|
||||
|
@ -244,6 +246,10 @@ public:
|
|||
{ return resource.border_width; }
|
||||
inline unsigned int getResizeZones(void) const
|
||||
{ return resource.resize_zones; }
|
||||
inline bool getPlaceIgnoreShaded(void) const
|
||||
{ return resource.ignore_shaded; }
|
||||
inline bool getPlaceIgnoreMaximized(void) const
|
||||
{ return resource.ignore_maximized; }
|
||||
|
||||
inline unsigned int getCurrentWorkspaceID(void) const
|
||||
{ return current_workspace->getID(); }
|
||||
|
@ -280,6 +286,8 @@ public:
|
|||
void saveWindowToWindowSnap(bool s);
|
||||
void saveWindowCornerSnap(bool s);
|
||||
void saveResizeZones(unsigned int z);
|
||||
void savePlaceIgnoreShaded(bool i);
|
||||
void savePlaceIgnoreMaximized(bool i);
|
||||
inline void iconUpdate(void) { iconmenu->update(); }
|
||||
|
||||
#ifdef HAVE_STRFTIME
|
||||
|
|
|
@ -572,7 +572,8 @@ bool Workspace::smartPlacement(Rect& win, const Rect& availableArea) {
|
|||
for (; wit != end; ++wit) {
|
||||
const BlackboxWindow* const curr = *wit;
|
||||
|
||||
if (curr->isShaded()) continue;
|
||||
if (curr->isShaded() && screen->getPlaceIgnoreShaded()) continue;
|
||||
if (curr->isMaximizedFull() && screen->getPlaceIgnoreMaximized()) continue;
|
||||
|
||||
tmp.setRect(curr->frameRect().x(), curr->frameRect().y(),
|
||||
curr->frameRect().width() + screen->getBorderWidth(),
|
||||
|
|
Loading…
Reference in a new issue