mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-15 05:08:41 -09:00
Expose active window positon on move to reducer (#3470)
This commit is contained in:
parent
80bb82122a
commit
1747c57bc3
3 changed files with 7 additions and 5 deletions
|
|
@ -217,8 +217,9 @@ module.exports = class Window {
|
||||||
for (const ev of ['maximize', 'unmaximize', 'minimize', 'restore']) {
|
for (const ev of ['maximize', 'unmaximize', 'minimize', 'restore']) {
|
||||||
window.on(ev, () => rpc.emit('windowGeometry change'));
|
window.on(ev, () => rpc.emit('windowGeometry change'));
|
||||||
}
|
}
|
||||||
rpc.win.on('move', () => {
|
window.on('move', () => {
|
||||||
rpc.emit('move');
|
const position = window.getPosition();
|
||||||
|
rpc.emit('move', {bounds: {x: position[0], y: position[1]}});
|
||||||
});
|
});
|
||||||
rpc.on('close', () => {
|
rpc.on('close', () => {
|
||||||
window.close();
|
window.close();
|
||||||
|
|
|
||||||
|
|
@ -229,10 +229,11 @@ export function moveTo(i) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function windowMove() {
|
export function windowMove(window) {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: UI_WINDOW_MOVE,
|
type: UI_WINDOW_MOVE,
|
||||||
|
window,
|
||||||
effect() {
|
effect() {
|
||||||
dispatch(setFontSmoothing());
|
dispatch(setFontSmoothing());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -162,8 +162,8 @@ rpc.on('update available', ({releaseName, releaseNotes, releaseUrl, canInstall})
|
||||||
store_.dispatch(updaterActions.updateAvailable(releaseName, releaseNotes, releaseUrl, canInstall));
|
store_.dispatch(updaterActions.updateAvailable(releaseName, releaseNotes, releaseUrl, canInstall));
|
||||||
});
|
});
|
||||||
|
|
||||||
rpc.on('move', () => {
|
rpc.on('move', window => {
|
||||||
store_.dispatch(uiActions.windowMove());
|
store_.dispatch(uiActions.windowMove(window));
|
||||||
});
|
});
|
||||||
|
|
||||||
rpc.on('windowGeometry change', () => {
|
rpc.on('windowGeometry change', () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue