Skip to content

Commit 34e151c

Browse files
committed
Update os-gui to 0.7.3
This fixes the position of the help window when minimized.
1 parent cf4ba40 commit 34e151c

File tree

7 files changed

+33
-15
lines changed

7 files changed

+33
-15
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ See [**Development Setup**](./README.md#Development-Setup) on the readme.
3232
- The project uses [jQuery](https://jquery.com/), and a convention of prefixing variables that hold jQuery objects with `$`
3333
- There are also some weird pseudo-classes like `$ColorBox` which extend and return jQuery objects. I don't recommend this pattern for new code.
3434
- Menu code and windowing code lives in the [os-gui](https://github.com/1j01/os-gui) project.
35-
- It can be synced (one-way) by running `npm i os-gui@latest && npm run sync-os-gui`
36-
- To develop os-gui in the context of jspaint, you can run `npm link` in a clone of os-gui, then run `npm link os-gui` in jspaint and then `npm run sync-os-gui` after making any changes in os-gui.
35+
- It can be synced (one-way) by running `npm i os-gui@latest --save-exact && npm run sync-os-gui`
36+
- To develop os-gui in the context of jspaint, you can run `npm link` in a clone of os-gui, then run `npm link os-gui && npm run sync-os-gui` in jspaint after making any changes in os-gui.
3737
- (Maybe I should version this using git-subrepo?)
3838
- Some window behavior specific to jspaint is in `$ToolWindow.js` and `$Component.js`
3939
- `image-manipulation.js` should contain just rendering related code, and ideally no dialogs except maybe some error messages.

lib/os-gui/$Window.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -726,9 +726,9 @@ function $Window(options = {}) {
726726
$w.css({
727727
position: "fixed",
728728
top: `calc(100% - ${titlebar_height + 5}px)`,
729-
left: `${to_x}`,
730-
width: `${to_width}`,
731-
height: `${titlebar_height}`,
729+
left: `${to_x}px`,
730+
width: `${to_width}px`,
731+
height: `${titlebar_height}px`,
732732
});
733733
}
734734
};
@@ -1511,7 +1511,13 @@ You can also disable this warning by passing {iframes: {ignoreCrossOrigin: true}
15111511
resize_pointer_y = e.clientY;
15121512
resize_pointer_id = (e.pointerId ?? e.originalEvent?.pointerId); // originalEvent doesn't exist for triggerHandler()
15131513

1514-
$handle[0].setPointerCapture(resize_pointer_id); // keeps cursor consistent when mouse moves over other elements
1514+
try {
1515+
$handle[0].setPointerCapture(resize_pointer_id); // keeps cursor consistent when mouse moves over other elements
1516+
} catch (error) {
1517+
// Prevent error from failing test; Cypress sends synthetic events that aren't trusted; I could pass a pointerId but not an active pointer id
1518+
// NotFoundError: Failed to execute 'setPointerCapture' on 'Element': No active pointer with the given id is found.
1519+
console.warn("Failed to capture pointer for resize handle drag:", error);
1520+
}
15151521

15161522
// handle_pointermove(e); // was useful for checking that the offset is correct (should not do anything, if it's correct!)
15171523
});
@@ -1692,6 +1698,8 @@ You can also disable this warning by passing {iframes: {ignoreCrossOrigin: true}
16921698
$component.detach();
16931699
}
16941700
$w.closed = true;
1701+
minimize_slots[$w._minimize_slot_index] = null;
1702+
16951703
$event_target.triggerHandler("closed");
16961704
$w.trigger("closed");
16971705
// TODO: change usages of "close" to "closed" where appropriate

lib/os-gui/build/layout.css

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/os-gui/build/layout.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/os-gui/build/layout.rtl.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ body > .window-titlebar {
5050
display: none; /* prevent resizing when window is minimized */
5151
}
5252

53+
.os-window.minimized-without-taskbar .menus {
54+
display: none; /* hide menubar when window is minimized */
55+
}
56+
57+
5358
/* Fix dragging things (like windows) over iframes */
5459
.dragging iframe {
5560
pointer-events: none;

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
"globals": "^15.3.0",
107107
"npm-run-all": "^4.1.5",
108108
"onchange": "^7.1.0",
109-
"os-gui": "0.7.2",
109+
"os-gui": "0.7.3",
110110
"rtlcss": "^4.1.1",
111111
"start-server-and-test": "^2.0.3",
112112
"typescript": "^5.4.3"

0 commit comments

Comments
 (0)