Skip to content

Commit 74c59cd

Browse files
committed
Updated size synchronization
1 parent cbb6cd5 commit 74c59cd

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

src/main/widgets/containers/Window.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -728,43 +728,43 @@ namespace lsp
728728
return;
729729

730730
// There is no actor - simple show
731+
const bool is_dialog = sBorderStyle.get() == ws::BS_DIALOG;
731732
if (wnd == NULL)
732733
{
733734
pWindow->show();
735+
if (is_dialog)
736+
pWindow->take_focus();
734737
return;
735738
}
736739

737740
// Correct window location
738-
switch (sBorderStyle.get())
741+
if (is_dialog)
739742
{
740-
case ws::BS_DIALOG:
741-
{
742-
ws::rectangle_t r, rw;
743-
r.nLeft = 0;
744-
r.nTop = 0;
745-
r.nWidth = 0;
746-
r.nHeight = 0;
743+
ws::rectangle_t r, rw;
744+
r.nLeft = 0;
745+
r.nTop = 0;
746+
r.nWidth = 0;
747+
r.nHeight = 0;
747748

748-
rw.nLeft = 0;
749-
rw.nTop = 0;
750-
rw.nWidth = 0;
751-
rw.nHeight = 0;
749+
rw.nLeft = 0;
750+
rw.nTop = 0;
751+
rw.nWidth = 0;
752+
rw.nHeight = 0;
752753

753-
wnd->get_absolute_geometry(&r);
754-
pWindow->get_geometry(&rw);
754+
wnd->get_absolute_geometry(&r);
755+
pWindow->get_geometry(&rw);
755756

756-
ssize_t left = r.nLeft + ((r.nWidth - rw.nWidth) / 2);
757-
ssize_t top = r.nTop + ((r.nHeight - rw.nHeight) / 2);
757+
ssize_t left = r.nLeft + ((r.nWidth - rw.nWidth) / 2);
758+
ssize_t top = r.nTop + ((r.nHeight - rw.nHeight) / 2);
758759

759-
sPosition.set(left, top);
760-
break;
761-
}
762-
default:
763-
break;
760+
sPosition.set(left, top);
764761
}
765762

766763
// Show over the actor window
764+
sync_size(false);
767765
pWindow->show(wnd);
766+
if (is_dialog)
767+
pWindow->take_focus();
768768
}
769769

770770
void Window::show()

0 commit comments

Comments
 (0)