diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2022-02-19 08:15:43 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2022-02-19 08:15:43 +0200 |
commit | 1ef7170f2b1b8c48fababc112673afa17729033f (patch) | |
tree | 1339f42ec947a367de792a95886decfefa0cc87d /src/ui | |
parent | dd9add718c4a9a2b29cd38b05886f22877b89b35 (diff) |
App: Save multiple window rectangles
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/root.c | 11 | ||||
-rw-r--r-- | src/ui/root.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/ui/root.c b/src/ui/root.c index eeb5956f..7e4b4863 100644 --- a/src/ui/root.c +++ b/src/ui/root.c | |||
@@ -468,6 +468,10 @@ static iBool handleRootCommands_(iWidget *root, const char *cmd) { | |||
468 | return iFalse; | 468 | return iFalse; |
469 | } | 469 | } |
470 | else if (equal_Command(cmd, "window.setrect")) { | 470 | else if (equal_Command(cmd, "window.setrect")) { |
471 | if (hasLabel_Command(cmd, "index") && | ||
472 | argU32Label_Command(cmd, "index") != windowIndex_Root(root->root)) { | ||
473 | return iFalse; | ||
474 | } | ||
471 | const int snap = argLabel_Command(cmd, "snap"); | 475 | const int snap = argLabel_Command(cmd, "snap"); |
472 | if (snap) { | 476 | if (snap) { |
473 | iMainWindow *window = get_MainWindow(); | 477 | iMainWindow *window = get_MainWindow(); |
@@ -1776,6 +1780,13 @@ void showToolbar_Root(iRoot *d, iBool show) { | |||
1776 | } | 1780 | } |
1777 | } | 1781 | } |
1778 | 1782 | ||
1783 | size_t windowIndex_Root(const iRoot *d) { | ||
1784 | if (type_Window(d->window) == main_WindowType) { | ||
1785 | return windowIndex_App(as_MainWindow(d->window)); | ||
1786 | } | ||
1787 | return iInvalidPos; | ||
1788 | } | ||
1789 | |||
1779 | iInt2 size_Root(const iRoot *d) { | 1790 | iInt2 size_Root(const iRoot *d) { |
1780 | return d && d->widget ? d->widget->rect.size : zero_I2(); | 1791 | return d && d->widget ? d->widget->rect.size : zero_I2(); |
1781 | } | 1792 | } |
diff --git a/src/ui/root.h b/src/ui/root.h index a81ebdf7..3b053c9e 100644 --- a/src/ui/root.h +++ b/src/ui/root.h | |||
@@ -47,6 +47,7 @@ void showOrHideNewTabButton_Root (iRoot *); | |||
47 | 47 | ||
48 | void notifyVisualOffsetChange_Root (iRoot *); | 48 | void notifyVisualOffsetChange_Root (iRoot *); |
49 | 49 | ||
50 | size_t windowIndex_Root (const iRoot *); | ||
50 | iInt2 size_Root (const iRoot *); | 51 | iInt2 size_Root (const iRoot *); |
51 | iRect rect_Root (const iRoot *); | 52 | iRect rect_Root (const iRoot *); |
52 | iRect safeRect_Root (const iRoot *); | 53 | iRect safeRect_Root (const iRoot *); |