summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2022-02-19 08:15:43 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2022-02-19 08:15:43 +0200
commit1ef7170f2b1b8c48fababc112673afa17729033f (patch)
tree1339f42ec947a367de792a95886decfefa0cc87d /src/ui
parentdd9add718c4a9a2b29cd38b05886f22877b89b35 (diff)
App: Save multiple window rectangles
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/root.c11
-rw-r--r--src/ui/root.h1
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
1783size_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
1779iInt2 size_Root(const iRoot *d) { 1790iInt2 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
48void notifyVisualOffsetChange_Root (iRoot *); 48void notifyVisualOffsetChange_Root (iRoot *);
49 49
50size_t windowIndex_Root (const iRoot *);
50iInt2 size_Root (const iRoot *); 51iInt2 size_Root (const iRoot *);
51iRect rect_Root (const iRoot *); 52iRect rect_Root (const iRoot *);
52iRect safeRect_Root (const iRoot *); 53iRect safeRect_Root (const iRoot *);