aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc32
1 files changed, 14 insertions, 18 deletions
diff --git a/src/Window.cc b/src/Window.cc
index b1b91cb..ccdc613 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -508,9 +508,6 @@ void FluxboxWindow::init() {
508 508
509 restoreAttributes(); 509 restoreAttributes();
510 510
511 if (m_workspace_number < 0 || m_workspace_number >= screen().numberOfWorkspaces())
512 m_workspace_number = screen().currentWorkspaceID();
513
514 bool place_window = (m_old_pos_x == 0); 511 bool place_window = (m_old_pos_x == 0);
515 512
516 if (fluxbox.isStartup()) 513 if (fluxbox.isStartup())
@@ -560,7 +557,6 @@ void FluxboxWindow::init() {
560 moveResize(frame().x(), frame().y(), real_width, real_height); 557 moveResize(frame().x(), frame().y(), real_width, real_height);
561 558
562 screen().getWorkspace(m_workspace_number)->addWindow(*this, place_window); 559 screen().getWorkspace(m_workspace_number)->addWindow(*this, place_window);
563 setWorkspace(m_workspace_number);
564 560
565 if (maximized && functions.maximize) { // start maximized 561 if (maximized && functions.maximize) { // start maximized
566 // This will set it to the appropriate style of maximisation 562 // This will set it to the appropriate style of maximisation
@@ -1317,7 +1313,7 @@ void FluxboxWindow::resize(unsigned int width, unsigned int height) {
1317 1313
1318 // magic to detect if moved during initialisation 1314 // magic to detect if moved during initialisation
1319 // we restore the old state, because we were a resize, not a moveResize! 1315 // we restore the old state, because we were a resize, not a moveResize!
1320 if (!isInitialized()) 1316 if (!m_initialized)
1321 m_old_pos_x = old_x; 1317 m_old_pos_x = old_x;
1322} 1318}
1323 1319
@@ -1326,7 +1322,7 @@ void FluxboxWindow::moveResize(int new_x, int new_y,
1326 unsigned int new_width, unsigned int new_height, bool send_event) { 1322 unsigned int new_width, unsigned int new_height, bool send_event) {
1327 1323
1328 // magic to detect if moved during initialisation 1324 // magic to detect if moved during initialisation
1329 if (!isInitialized()) 1325 if (!m_initialized)
1330 m_old_pos_x = 1; 1326 m_old_pos_x = 1;
1331 1327
1332 send_event = send_event || (frame().x() != new_x || frame().y() != new_y); 1328 send_event = send_event || (frame().x() != new_x || frame().y() != new_y);
@@ -1367,7 +1363,7 @@ void FluxboxWindow::moveResizeForClient(int new_x, int new_y,
1367 unsigned int new_width, unsigned int new_height, int gravity, unsigned int client_bw) { 1363 unsigned int new_width, unsigned int new_height, int gravity, unsigned int client_bw) {
1368 1364
1369 // magic to detect if moved during initialisation 1365 // magic to detect if moved during initialisation
1370 if (!isInitialized()) 1366 if (!m_initialized)
1371 m_old_pos_x = 1; 1367 m_old_pos_x = 1;
1372 frame().moveResizeForClient(new_x, new_y, new_width, new_height, gravity, client_bw); 1368 frame().moveResizeForClient(new_x, new_y, new_width, new_height, gravity, client_bw);
1373 setFocusFlag(focused); 1369 setFocusFlag(focused);
@@ -1804,7 +1800,7 @@ void FluxboxWindow::setWorkspace(int n) {
1804 m_blackbox_attrib.workspace = m_workspace_number; 1800 m_blackbox_attrib.workspace = m_workspace_number;
1805 1801
1806 // notify workspace change 1802 // notify workspace change
1807 if (isInitialized() && !stuck && old_wkspc != m_workspace_number) { 1803 if (m_initialized && !stuck && old_wkspc != m_workspace_number) {
1808#ifdef DEBUG 1804#ifdef DEBUG
1809 cerr<<this<<" notify workspace signal"<<endl; 1805 cerr<<this<<" notify workspace signal"<<endl;
1810#endif // DEBUG 1806#endif // DEBUG
@@ -1818,7 +1814,7 @@ void FluxboxWindow::setLayerNum(int layernum) {
1818 m_blackbox_attrib.flags |= ATTRIB_STACK; 1814 m_blackbox_attrib.flags |= ATTRIB_STACK;
1819 m_blackbox_attrib.stack = layernum; 1815 m_blackbox_attrib.stack = layernum;
1820 1816
1821 if (isInitialized()) { 1817 if (m_initialized) {
1822 saveBlackboxAttribs(); 1818 saveBlackboxAttribs();
1823 1819
1824#ifdef DEBUG 1820#ifdef DEBUG
@@ -1835,7 +1831,7 @@ void FluxboxWindow::shade() {
1835 return; 1831 return;
1836 1832
1837 // we're toggling, so if they're equal now, we need to change it 1833 // we're toggling, so if they're equal now, we need to change it
1838 if (isInitialized() && m_frame.isShaded() == shaded) 1834 if (m_initialized && m_frame.isShaded() == shaded)
1839 frame().shade(); 1835 frame().shade();
1840 1836
1841 if (shaded) { 1837 if (shaded) {
@@ -1843,14 +1839,14 @@ void FluxboxWindow::shade() {
1843 m_blackbox_attrib.flags ^= ATTRIB_SHADED; 1839 m_blackbox_attrib.flags ^= ATTRIB_SHADED;
1844 m_blackbox_attrib.attrib ^= ATTRIB_SHADED; 1840 m_blackbox_attrib.attrib ^= ATTRIB_SHADED;
1845 1841
1846 if (isInitialized()) 1842 if (m_initialized)
1847 setState(NormalState, false); 1843 setState(NormalState, false);
1848 } else { 1844 } else {
1849 shaded = true; 1845 shaded = true;
1850 m_blackbox_attrib.flags |= ATTRIB_SHADED; 1846 m_blackbox_attrib.flags |= ATTRIB_SHADED;
1851 m_blackbox_attrib.attrib |= ATTRIB_SHADED; 1847 m_blackbox_attrib.attrib |= ATTRIB_SHADED;
1852 // shading is the same as iconic 1848 // shading is the same as iconic
1853 if (isInitialized()) 1849 if (m_initialized)
1854 setState(IconicState, false); 1850 setState(IconicState, false);
1855 } 1851 }
1856 1852
@@ -1886,7 +1882,7 @@ void FluxboxWindow::stick() {
1886 1882
1887 } 1883 }
1888 1884
1889 if (isInitialized()) { 1885 if (m_initialized) {
1890 setState(m_current_state, false); 1886 setState(m_current_state, false);
1891 // notify since some things consider "stuck" to be a pseudo-workspace 1887 // notify since some things consider "stuck" to be a pseudo-workspace
1892 m_workspacesig.notify(); 1888 m_workspacesig.notify();
@@ -1958,7 +1954,7 @@ void FluxboxWindow::raiseLayer() {
1958 if (layerNum() == ::Layer::MENU + 1) 1954 if (layerNum() == ::Layer::MENU + 1)
1959 return; 1955 return;
1960 1956
1961 if (!isInitialized()) { 1957 if (!m_initialized) {
1962 m_layernum++; 1958 m_layernum++;
1963 return; 1959 return;
1964 } 1960 }
@@ -1995,7 +1991,7 @@ void FluxboxWindow::raiseLayer() {
1995} 1991}
1996 1992
1997void FluxboxWindow::lowerLayer() { 1993void FluxboxWindow::lowerLayer() {
1998 if (!isInitialized()) { 1994 if (!m_initialized) {
1999 if (m_layernum > 0) 1995 if (m_layernum > 0)
2000 m_layernum--; 1996 m_layernum--;
2001 return; 1997 return;
@@ -2042,7 +2038,7 @@ void FluxboxWindow::moveToLayer(int layernum) {
2042 layernum = ::Layer::MENU + 1; 2038 layernum = ::Layer::MENU + 1;
2043 } 2039 }
2044 2040
2045 if (!isInitialized()) { 2041 if (!m_initialized) {
2046 m_layernum = layernum; 2042 m_layernum = layernum;
2047 return; 2043 return;
2048 } 2044 }
@@ -2079,13 +2075,13 @@ void FluxboxWindow::moveToLayer(int layernum) {
2079 2075
2080void FluxboxWindow::setFocusHidden(bool value) { 2076void FluxboxWindow::setFocusHidden(bool value) {
2081 m_focus_hidden = value; 2077 m_focus_hidden = value;
2082 if (isInitialized()) 2078 if (m_initialized)
2083 m_statesig.notify(); 2079 m_statesig.notify();
2084} 2080}
2085 2081
2086void FluxboxWindow::setIconHidden(bool value) { 2082void FluxboxWindow::setIconHidden(bool value) {
2087 m_icon_hidden= value; 2083 m_icon_hidden= value;
2088 if (isInitialized()) 2084 if (m_initialized)
2089 m_statesig.notify(); 2085 m_statesig.notify();
2090} 2086}
2091 2087