aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authormathias <mathias>2004-12-21 16:17:14 (GMT)
committermathias <mathias>2004-12-21 16:17:14 (GMT)
commitad10a3543e278aea0dd8e1fb83fa79b93025d14b (patch)
treed0ba04c54c53a027d6a39dd1c9a3853fcd6e0042 /src/Window.cc
parenta88d3b39ad76182bf120b8c69b80104f7b61cba8 (diff)
downloadfluxbox-ad10a3543e278aea0dd8e1fb83fa79b93025d14b.zip
fluxbox-ad10a3543e278aea0dd8e1fb83fa79b93025d14b.tar.bz2
fix a problem with enabling/disabling fullscreen-mode in gtk2-apps
* synchronize _NET_WM_STATE in Ewmh.cc * added FluxboxWindow::setFullscreen(bool) to Window.cc furthermore, if a window is in fullscreenmode any existing shape is disabled (looks pretty annoying in mplayer for example)
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc65
1 files changed, 64 insertions, 1 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 83f8771..f1cef6d 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -280,7 +280,7 @@ FluxboxWindow::FluxboxWindow(WinClient &client, FbWinFrameTheme &tm,
280 m_themelistener(*this), 280 m_themelistener(*this),
281 moving(false), resizing(false), shaded(false), 281 moving(false), resizing(false), shaded(false),
282 iconic(false), focused(false), 282 iconic(false), focused(false),
283 stuck(false), m_managed(false), 283 stuck(false), m_managed(false), fullscreen(false),
284 maximized(MAX_NONE), 284 maximized(MAX_NONE),
285 m_attaching_tab(0), 285 m_attaching_tab(0),
286 m_screen(client.screen()), 286 m_screen(client.screen()),
@@ -292,6 +292,7 @@ FluxboxWindow::FluxboxWindow(WinClient &client, FbWinFrameTheme &tm,
292 m_workspace_number(0), 292 m_workspace_number(0),
293 m_current_state(0), 293 m_current_state(0),
294 m_old_decoration(DECOR_NORMAL), 294 m_old_decoration(DECOR_NORMAL),
295 m_old_decoration_mask(0),
295 m_client(&client), 296 m_client(&client),
296 m_toggled_decos(false), 297 m_toggled_decos(false),
297 m_shaped(false), 298 m_shaped(false),
@@ -302,6 +303,7 @@ FluxboxWindow::FluxboxWindow(WinClient &client, FbWinFrameTheme &tm,
302 m_frame(tm, client.screen().imageControl(), 0, 0, 100, 100), 303 m_frame(tm, client.screen().imageControl(), 0, 0, 100, 100),
303 m_layeritem(m_frame.window(), layer), 304 m_layeritem(m_frame.window(), layer),
304 m_layernum(layer.getLayerNum()), 305 m_layernum(layer.getLayerNum()),
306 m_old_layernum(0),
305 m_parent(client.screen().rootWindow()), 307 m_parent(client.screen().rootWindow()),
306 m_resize_corner(RIGHTBOTTOM) { 308 m_resize_corner(RIGHTBOTTOM) {
307 309
@@ -603,6 +605,7 @@ void FluxboxWindow::init() {
603void FluxboxWindow::shape() { 605void FluxboxWindow::shape() {
604#ifdef SHAPE 606#ifdef SHAPE
605 if (m_shaped) { 607 if (m_shaped) {
608 if (isFullscreen())
606 XShapeCombineShape(display, 609 XShapeCombineShape(display,
607 frame().window().window(), ShapeBounding, 610 frame().window().window(), ShapeBounding,
608 0, frame().clientArea().y(), // xOff, yOff 611 0, frame().clientArea().y(), // xOff, yOff
@@ -1579,10 +1582,70 @@ void FluxboxWindow::withdraw(bool interrupt_moving) {
1579 hide(interrupt_moving); 1582 hide(interrupt_moving);
1580} 1583}
1581 1584
1585/** setFullscreen mode:
1586
1587 - maximize as big as the screen is, dont care about slit / toolbar
1588 - raise to toplayer
1589*/
1590void FluxboxWindow::setFullscreen(bool flag) {
1591
1592 const int head = screen().getHead(fbWindow());
1593 Fluxbox* fb = Fluxbox::instance();
1594
1595 if (flag && !isFullscreen()) {
1596
1597 if (isIconic())
1598 deiconify();
1599
1600 if (isShaded())
1601 shade();
1602
1603 frame().setUseShape(false);
1604
1605 m_old_decoration_mask = decorationMask();
1606 m_old_layernum =layerNum();
1607 m_old_pos_x = frame().x();
1608 m_old_pos_y = frame().y();
1609 m_old_width = frame().width();
1610 m_old_height = frame().height();
1611
1612 // clear decorations
1613 setDecorationMask(0);
1614
1615 // be xinerama aware
1616 moveResize(screen().getHeadX(head), screen().getHeadY(head),
1617 screen().getHeadWidth(head), screen().getHeadHeight(head));
1618 moveToLayer(Fluxbox::instance()->getAboveDockLayer());
1619
1620 fullscreen = true;
1621
1622 stateSig().notify();
1623
1624 } else if (!flag && isFullscreen()) {
1625
1626 fullscreen = false;
1627
1628 setDecorationMask(m_old_decoration_mask);
1629 frame().setUseShape(!m_shaped);
1630
1631 moveResize(m_old_pos_x, m_old_pos_y, m_old_width, m_old_height);
1632 moveToLayer(m_old_layernum);
1633
1634 m_old_decoration_mask = 0;
1635 m_old_layernum = Fluxbox::instance()->getNormalLayer();
1636
1637 stateSig().notify();
1638 }
1639}
1640
1582/** 1641/**
1583 Maximize window both horizontal and vertical 1642 Maximize window both horizontal and vertical
1584*/ 1643*/
1585void FluxboxWindow::maximize(int type) { 1644void FluxboxWindow::maximize(int type) {
1645
1646 if (isFullscreen())
1647 return;
1648
1586 if (isIconic()) 1649 if (isIconic())
1587 deiconify(); 1650 deiconify();
1588 1651