aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-08-22 10:36:26 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-08-22 10:36:26 (GMT)
commit8681220f5361fef500d7eda28d9f22bbf0a006e4 (patch)
treec4a53e66ef743fe52f8176e7cf828a8796ac7bc8
parent2f3a48f17fead42b6b2ed906318641e279bb9505 (diff)
downloadfluxbox_pavel-8681220f5361fef500d7eda28d9f22bbf0a006e4.zip
fluxbox_pavel-8681220f5361fef500d7eda28d9f22bbf0a006e4.tar.bz2
don't apply rounded corners to windows without decorations
-rw-r--r--src/FbWinFrame.cc30
-rw-r--r--src/FbWinFrame.hh4
-rw-r--r--src/Window.cc4
3 files changed, 12 insertions, 26 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index 284a1b5..f050a6d 100644
--- a/src/FbWinFrame.cc
+++ b/src/FbWinFrame.cc
@@ -91,8 +91,7 @@ FbWinFrame::FbWinFrame(BScreen &screen,
91 m_height_before_shade(1), 91 m_height_before_shade(1),
92 m_focused_alpha(AlphaAcc(*theme.focusedTheme(), &FbWinFrameTheme::alpha)), 92 m_focused_alpha(AlphaAcc(*theme.focusedTheme(), &FbWinFrameTheme::alpha)),
93 m_unfocused_alpha(AlphaAcc(*theme.unfocusedTheme(), &FbWinFrameTheme::alpha)), 93 m_unfocused_alpha(AlphaAcc(*theme.unfocusedTheme(), &FbWinFrameTheme::alpha)),
94 m_shape(m_window, theme->shapePlace()), 94 m_shape(m_window, theme->shapePlace()) {
95 m_disable_themeshape(false) {
96 init(); 95 init();
97} 96}
98 97
@@ -994,26 +993,12 @@ void FbWinFrame::reconfigure() {
994 m_need_render = true; 993 m_need_render = true;
995 } 994 }
996 995
997 if (m_disable_themeshape) 996 m_shape.setPlaces(getShape());
998 m_shape.setPlaces(FbTk::Shape::NONE);
999 else
1000 m_shape.setPlaces(theme()->shapePlace());
1001
1002 m_shape.setShapeOffsets(0, titlebarHeight()); 997 m_shape.setShapeOffsets(0, titlebarHeight());
1003 998
1004 // titlebar stuff rendered already by reconftitlebar 999 // titlebar stuff rendered already by reconftitlebar
1005} 1000}
1006 1001
1007void FbWinFrame::setUseShape(bool value) {
1008 m_disable_themeshape = !value;
1009
1010 if (m_disable_themeshape)
1011 m_shape.setPlaces(FbTk::Shape::NONE);
1012 else
1013 m_shape.setPlaces(theme()->shapePlace());
1014
1015}
1016
1017void FbWinFrame::setShapingClient(FbTk::FbWindow *win, bool always_update) { 1002void FbWinFrame::setShapingClient(FbTk::FbWindow *win, bool always_update) {
1018 m_shape.setShapeSource(win, 0, titlebarHeight(), always_update); 1003 m_shape.setShapeSource(win, 0, titlebarHeight(), always_update);
1019} 1004}
@@ -1319,8 +1304,6 @@ void FbWinFrame::init() {
1319 if (theme()->handleWidth() == 0) 1304 if (theme()->handleWidth() == 0)
1320 m_use_handle = false; 1305 m_use_handle = false;
1321 1306
1322 m_disable_themeshape = false;
1323
1324 m_handle.showSubwindows(); 1307 m_handle.showSubwindows();
1325 1308
1326 // clear pixmaps 1309 // clear pixmaps
@@ -1483,6 +1466,15 @@ bool FbWinFrame::useHandle() const {
1483 return !m_state.fullscreen && m_state.deco_mask & DECORM_HANDLE; 1466 return !m_state.fullscreen && m_state.deco_mask & DECORM_HANDLE;
1484} 1467}
1485 1468
1469int FbWinFrame::getShape() const {
1470 int shape = theme()->shapePlace();
1471 if (!useTitlebar())
1472 shape &= ~(FbTk::Shape::TOPRIGHT|FbTk::Shape::TOPLEFT);
1473 if (!useHandle())
1474 shape &= ~(FbTk::Shape::BOTTOMRIGHT|FbTk::Shape::BOTTOMLEFT);
1475 return shape;
1476}
1477
1486void FbWinFrame::applyDecorations() { 1478void FbWinFrame::applyDecorations() {
1487 int grav_x=0, grav_y=0; 1479 int grav_x=0, grav_y=0;
1488 // negate gravity 1480 // negate gravity
diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh
index 3f10f54..5756c8e 100644
--- a/src/FbWinFrame.hh
+++ b/src/FbWinFrame.hh
@@ -243,6 +243,7 @@ public:
243 bool useTabs() const; 243 bool useTabs() const;
244 bool useTitlebar() const; 244 bool useTitlebar() const;
245 bool useHandle() const; 245 bool useHandle() const;
246 int getShape() const;
246 247
247 // this function translates its arguments according to win_gravity 248 // this function translates its arguments according to win_gravity
248 // if win_gravity is negative, it does an inverse translation 249 // if win_gravity is negative, it does an inverse translation
@@ -259,7 +260,6 @@ public:
259 //@} 260 //@}
260 261
261 void reconfigure(); 262 void reconfigure();
262 void setUseShape(bool value);
263 void setShapingClient(FbTk::FbWindow *win, bool always_update); 263 void setShapingClient(FbTk::FbWindow *win, bool always_update);
264 void updateShape() { m_shape.update(); } 264 void updateShape() { m_shape.update(); }
265 265
@@ -455,8 +455,6 @@ private:
455 FbTk::DefaultValue<unsigned char, AlphaAcc> m_unfocused_alpha; 455 FbTk::DefaultValue<unsigned char, AlphaAcc> m_unfocused_alpha;
456 456
457 FbTk::Shape m_shape; 457 FbTk::Shape m_shape;
458
459 bool m_disable_themeshape;
460}; 458};
461 459
462#endif // FBWINFRAME_HH 460#endif // FBWINFRAME_HH
diff --git a/src/Window.cc b/src/Window.cc
index d7a2bee..79419d0 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -1451,8 +1451,6 @@ void FluxboxWindow::setFullscreen(bool flag) {
1451 if (isShaded()) 1451 if (isShaded())
1452 shade(); 1452 shade();
1453 1453
1454 frame().setUseShape(false);
1455
1456 m_old_layernum = layerNum(); 1454 m_old_layernum = layerNum();
1457 if (!maximized) { 1455 if (!maximized) {
1458 m_old_pos_x = frame().x(); 1456 m_old_pos_x = frame().x();
@@ -1483,8 +1481,6 @@ void FluxboxWindow::setFullscreen(bool flag) {
1483 fullscreen = false; 1481 fullscreen = false;
1484 frame().setFullscreen(false); 1482 frame().setFullscreen(false);
1485 1483
1486 frame().setUseShape(true);
1487
1488 // ensure we apply the sizehints here, otherwise some 1484 // ensure we apply the sizehints here, otherwise some
1489 // apps (eg xterm) end up a little bit .. crappy (visually) 1485 // apps (eg xterm) end up a little bit .. crappy (visually)
1490 frame().applySizeHints(m_old_width, m_old_height); 1486 frame().applySizeHints(m_old_width, m_old_height);