diff options
author | Mathias Gumz <akira at fluxbox dot org> | 2013-05-23 07:18:37 (GMT) |
---|---|---|
committer | Mathias Gumz <akira at fluxbox dot org> | 2013-05-23 07:18:37 (GMT) |
commit | 2da808667301d27110497e036b8cbdec6f65023d (patch) | |
tree | cd499cf5e37b0d0c7586326abe1ff956684e32e8 /src/Window.cc | |
parent | 9b0cedf9618f382c8691d3243668771e065732b2 (diff) | |
download | fluxbox-2da808667301d27110497e036b8cbdec6f65023d.zip fluxbox-2da808667301d27110497e036b8cbdec6f65023d.tar.bz2 |
Use shared code, minor code simplification
Diffstat (limited to 'src/Window.cc')
-rw-r--r-- | src/Window.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/Window.cc b/src/Window.cc index 1c9c795..9416978 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -223,11 +223,8 @@ bool isWindowVisibleOnSomeHeadOrScreen(FluxboxWindow const& w) { | |||
223 | 223 | ||
224 | if (w.screen().hasXinerama()) { // xinerama available => use head info | 224 | if (w.screen().hasXinerama()) { // xinerama available => use head info |
225 | return (0 != w.screen().getHead(real_x, real_y)); // if visible on some head | 225 | return (0 != w.screen().getHead(real_x, real_y)); // if visible on some head |
226 | } else { // no xinerama available => use screen info | ||
227 | return (real_x >= 0 && real_y >= 0 && | ||
228 | real_x <= (signed) w.screen().width() && | ||
229 | real_y <= (signed) w.screen().height()); // if visible on the screen | ||
230 | } | 226 | } |
227 | return RectangleUtil::insideRectangle(0, 0, w.screen().width(), w.screen().height(), real_x, real_y); | ||
231 | } | 228 | } |
232 | 229 | ||
233 | class SetClientCmd:public FbTk::Command<void> { | 230 | class SetClientCmd:public FbTk::Command<void> { |
@@ -464,14 +461,15 @@ void FluxboxWindow::init() { | |||
464 | 461 | ||
465 | setWindowType(m_client->getWindowType()); | 462 | setWindowType(m_client->getWindowType()); |
466 | 463 | ||
464 | bool is_visible = isWindowVisibleOnSomeHeadOrScreen(*this); | ||
465 | |||
467 | if (fluxbox.isStartup()) | 466 | if (fluxbox.isStartup()) |
468 | m_placed = true; | 467 | m_placed = true; |
469 | else if (m_client->isTransient() || | 468 | else if (m_client->isTransient() || |
470 | m_client->normal_hint_flags & (PPosition|USPosition)) { | 469 | m_client->normal_hint_flags & (PPosition|USPosition)) { |
471 | if (isWindowVisibleOnSomeHeadOrScreen(*this)) | 470 | m_placed = is_visible; |
472 | m_placed = true; | ||
473 | } else { | 471 | } else { |
474 | if (!isWindowVisibleOnSomeHeadOrScreen(*this)) { | 472 | if (!is_visible) { |
475 | int cur = screen().getHead(fbWindow()); | 473 | int cur = screen().getHead(fbWindow()); |
476 | move(screen().getHeadX(cur), screen().getHeadY(cur)); | 474 | move(screen().getHeadX(cur), screen().getHeadY(cur)); |
477 | m_placed = false; // allow placement strategy to fix position | 475 | m_placed = false; // allow placement strategy to fix position |