aboutsummaryrefslogtreecommitdiff
path: root/src/WinClient.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-08-16 07:22:12 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-08-16 07:22:12 (GMT)
commitfe412dbeef7af324a376cba338bff8c24e032d2e (patch)
treeeab03ffc2e6b94e70d78c29ae3384b2c265e7a18 /src/WinClient.cc
parent1d8dfcdf9ad5405f4eef18dc009ce8cfe6d27f29 (diff)
downloadfluxbox_pavel-fe412dbeef7af324a376cba338bff8c24e032d2e.zip
fluxbox_pavel-fe412dbeef7af324a376cba338bff8c24e032d2e.tar.bz2
move interpretation of normal hints to size hint class
Diffstat (limited to 'src/WinClient.cc')
-rw-r--r--src/WinClient.cc57
1 files changed, 1 insertions, 56 deletions
diff --git a/src/WinClient.cc b/src/WinClient.cc
index 2c9cdc6..14414b0 100644
--- a/src/WinClient.cc
+++ b/src/WinClient.cc
@@ -75,7 +75,6 @@ WinClient::WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin):
75 accepts_input(false), 75 accepts_input(false),
76 send_focus_message(false), 76 send_focus_message(false),
77 send_close_message(false), 77 send_close_message(false),
78 m_win_gravity(0),
79 m_title_override(false), 78 m_title_override(false),
80 m_icon_override(false), 79 m_icon_override(false),
81 m_window_type(Focusable::TYPE_NORMAL), 80 m_window_type(Focusable::TYPE_NORMAL),
@@ -467,61 +466,7 @@ void WinClient::updateWMNormalHints() {
467 sizehint.flags = 0; 466 sizehint.flags = 0;
468 467
469 normal_hint_flags = sizehint.flags; 468 normal_hint_flags = sizehint.flags;
470 469 m_size_hints.reset(sizehint);
471 if (sizehint.flags & PMinSize) {
472 m_size_hints.min_width = sizehint.min_width;
473 m_size_hints.min_height = sizehint.min_height;
474 } else
475 m_size_hints.min_width = m_size_hints.min_height = 1;
476
477 if (sizehint.flags & PBaseSize) {
478 m_size_hints.base_width = sizehint.base_width;
479 m_size_hints.base_height = sizehint.base_height;
480 if (!(sizehint.flags & PMinSize)) {
481 m_size_hints.min_width = m_size_hints.base_width;
482 m_size_hints.min_height = m_size_hints.base_height;
483 }
484 } else
485 m_size_hints.base_width = m_size_hints.base_height = 0;
486
487 if (sizehint.flags & PMaxSize) {
488 m_size_hints.max_width = sizehint.max_width;
489 m_size_hints.max_height = sizehint.max_height;
490 } else {
491 m_size_hints.max_width = 0; // unbounded
492 m_size_hints.max_height = 0;
493 }
494
495 if (sizehint.flags & PResizeInc) {
496 m_size_hints.width_inc = sizehint.width_inc;
497 m_size_hints.height_inc = sizehint.height_inc;
498 } else
499 m_size_hints.width_inc = m_size_hints.height_inc = 1;
500
501 if (sizehint.flags & PAspect) {
502 m_size_hints.min_aspect_x = sizehint.min_aspect.x;
503 m_size_hints.min_aspect_y = sizehint.min_aspect.y;
504 m_size_hints.max_aspect_x = sizehint.max_aspect.x;
505 m_size_hints.max_aspect_y = sizehint.max_aspect.y;
506 } else
507 m_size_hints.min_aspect_x = m_size_hints.min_aspect_y =
508 m_size_hints.max_aspect_x = m_size_hints.max_aspect_y = 0;
509
510 if (sizehint.flags & PWinGravity)
511 m_win_gravity = sizehint.win_gravity;
512 else
513 m_win_gravity = NorthWestGravity;
514
515 // some sanity checks
516 if (m_size_hints.width_inc == 0)
517 m_size_hints.width_inc = 1;
518 if (m_size_hints.height_inc == 0)
519 m_size_hints.height_inc = 1;
520
521 if (m_size_hints.base_width > m_size_hints.min_width)
522 m_size_hints.min_width = m_size_hints.base_width;
523 if (m_size_hints.base_height > m_size_hints.min_height)
524 m_size_hints.min_height = m_size_hints.base_height;
525} 470}
526 471
527Window WinClient::getGroupLeftWindow() const { 472Window WinClient::getGroupLeftWindow() const {