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
|
# Top to Bottom
|
||||||
$ #BottomTop
|
$ #BottomTop
|
||||||
# Bottom to Top
|
# Bottom to Top
|
||||||
|
$ #IgnoreShaded
|
||||||
|
# Ignore shaded windows
|
||||||
|
$ #IgnoreMax
|
||||||
|
# Ignore full-maximized windows
|
||||||
|
|
|
@ -229,6 +229,11 @@ Configmenu::Placementmenu::Placementmenu(Configmenu *cm):
|
||||||
BScreen::TopBottom);
|
BScreen::TopBottom);
|
||||||
insert(i18n(ConfigmenuSet, ConfigmenuBottomTop, "Bottom to Top"),
|
insert(i18n(ConfigmenuSet, ConfigmenuBottomTop, "Bottom to Top"),
|
||||||
BScreen::BottomTop);
|
BScreen::BottomTop);
|
||||||
|
insert(i18n(ConfigmenuSet, ConfigmenuIgnoreShaded, "Ignore shaded windows"),
|
||||||
|
BScreen::IgnoreShaded);
|
||||||
|
insert(i18n(ConfigmenuSet, ConfigmenuIgnoreMax,
|
||||||
|
"Ignore full-maximized windows"),
|
||||||
|
BScreen::IgnoreMaximized);
|
||||||
update();
|
update();
|
||||||
setValues();
|
setValues();
|
||||||
}
|
}
|
||||||
|
@ -255,6 +260,9 @@ void Configmenu::Placementmenu::setValues(void) {
|
||||||
setItemSelected(7, ! tb);
|
setItemSelected(7, ! tb);
|
||||||
setItemEnabled(6, e);
|
setItemEnabled(6, e);
|
||||||
setItemEnabled(7, 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(6, false);
|
||||||
setItemSelected(7, true);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -490,7 +490,7 @@ void BScreen::saveDateFormat(int f) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BScreen::saveClock24Hour(Bool c) {
|
void BScreen::saveClock24Hour(bool c) {
|
||||||
resource.clock24hour = c;
|
resource.clock24hour = c;
|
||||||
config->setValue(screenstr + "clockFormat", resource.clock24hour ? 24 : 12);
|
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) {
|
void BScreen::save_rc(void) {
|
||||||
saveSloppyFocus(resource.sloppy_focus);
|
saveSloppyFocus(resource.sloppy_focus);
|
||||||
saveAutoRaise(resource.auto_raise);
|
saveAutoRaise(resource.auto_raise);
|
||||||
|
@ -534,6 +548,8 @@ void BScreen::save_rc(void) {
|
||||||
saveDateFormat(resource.date_format);
|
saveDateFormat(resource.date_format);
|
||||||
savwClock24Hour(resource.clock24hour);
|
savwClock24Hour(resource.clock24hour);
|
||||||
#endif // HAVE_STRFTIME
|
#endif // HAVE_STRFTIME
|
||||||
|
savePlaceIgnoreShaded(resource.ignore_shaded);
|
||||||
|
savePlaceIgnoreMaximized(resource.ignore_maximized);
|
||||||
|
|
||||||
toolbar->save_rc();
|
toolbar->save_rc();
|
||||||
slit->save_rc();
|
slit->save_rc();
|
||||||
|
@ -639,9 +655,8 @@ void BScreen::load_rc(void) {
|
||||||
resource.placement_policy = RowSmartPlacement;
|
resource.placement_policy = RowSmartPlacement;
|
||||||
|
|
||||||
#ifdef HAVE_STRFTIME
|
#ifdef HAVE_STRFTIME
|
||||||
if (config->getValue(screenstr + "strftimeFormat", s))
|
if (! config->getValue(screenstr + "strftimeFormat",
|
||||||
resource.strftime_format = s;
|
resource.strftime_format))
|
||||||
else
|
|
||||||
resource.strftime_format = "%I:%M %p";
|
resource.strftime_format = "%I:%M %p";
|
||||||
#else // !HAVE_STRFTIME
|
#else // !HAVE_STRFTIME
|
||||||
long l;
|
long l;
|
||||||
|
@ -655,6 +670,14 @@ void BScreen::load_rc(void) {
|
||||||
l = 12;
|
l = 12;
|
||||||
resource.clock24hour = l == 24;
|
resource.clock24hour = l == 24;
|
||||||
#endif // HAVE_STRFTIME
|
#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,
|
bool sloppy_focus, auto_raise, auto_edge_balance, ordered_dither,
|
||||||
opaque_move, full_max, focus_new, focus_last, click_raise,
|
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;
|
BColor border_color;
|
||||||
|
|
||||||
unsigned int workspaces;
|
unsigned int workspaces;
|
||||||
|
@ -189,7 +190,8 @@ private:
|
||||||
void updateWorkArea(void);
|
void updateWorkArea(void);
|
||||||
public:
|
public:
|
||||||
enum { RowSmartPlacement = 1, ColSmartPlacement, CascadePlacement,
|
enum { RowSmartPlacement = 1, ColSmartPlacement, CascadePlacement,
|
||||||
UnderMousePlacement, LeftRight, RightLeft, TopBottom, BottomTop };
|
UnderMousePlacement, LeftRight, RightLeft, TopBottom, BottomTop,
|
||||||
|
IgnoreShaded, IgnoreMaximized };
|
||||||
enum { RoundBullet = 1, TriangleBullet, SquareBullet, NoBullet };
|
enum { RoundBullet = 1, TriangleBullet, SquareBullet, NoBullet };
|
||||||
enum { Restart = 1, RestartOther, Exit, Shutdown, Execute, Reconfigure,
|
enum { Restart = 1, RestartOther, Exit, Shutdown, Execute, Reconfigure,
|
||||||
WindowShade, WindowIconify, WindowMaximize, WindowClose, WindowRaise,
|
WindowShade, WindowIconify, WindowMaximize, WindowClose, WindowRaise,
|
||||||
|
@ -244,6 +246,10 @@ public:
|
||||||
{ return resource.border_width; }
|
{ return resource.border_width; }
|
||||||
inline unsigned int getResizeZones(void) const
|
inline unsigned int getResizeZones(void) const
|
||||||
{ return resource.resize_zones; }
|
{ 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
|
inline unsigned int getCurrentWorkspaceID(void) const
|
||||||
{ return current_workspace->getID(); }
|
{ return current_workspace->getID(); }
|
||||||
|
@ -280,6 +286,8 @@ public:
|
||||||
void saveWindowToWindowSnap(bool s);
|
void saveWindowToWindowSnap(bool s);
|
||||||
void saveWindowCornerSnap(bool s);
|
void saveWindowCornerSnap(bool s);
|
||||||
void saveResizeZones(unsigned int z);
|
void saveResizeZones(unsigned int z);
|
||||||
|
void savePlaceIgnoreShaded(bool i);
|
||||||
|
void savePlaceIgnoreMaximized(bool i);
|
||||||
inline void iconUpdate(void) { iconmenu->update(); }
|
inline void iconUpdate(void) { iconmenu->update(); }
|
||||||
|
|
||||||
#ifdef HAVE_STRFTIME
|
#ifdef HAVE_STRFTIME
|
||||||
|
|
|
@ -572,7 +572,8 @@ bool Workspace::smartPlacement(Rect& win, const Rect& availableArea) {
|
||||||
for (; wit != end; ++wit) {
|
for (; wit != end; ++wit) {
|
||||||
const BlackboxWindow* const curr = *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(),
|
tmp.setRect(curr->frameRect().x(), curr->frameRect().y(),
|
||||||
curr->frameRect().width() + screen->getBorderWidth(),
|
curr->frameRect().width() + screen->getBorderWidth(),
|
||||||
|
|
Loading…
Reference in a new issue