mirror of
https://github.com/rubickCenter/rubick
synced 2025-07-20 23:20:41 +08:00
parent
511b357e28
commit
1eeb0fad9a
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "rubick2",
|
"name": "rubick2",
|
||||||
"version": "0.0.6",
|
"version": "0.0.6-beta.1",
|
||||||
"author": "muwoo <2424880409@qq.com>",
|
"author": "muwoo <2424880409@qq.com>",
|
||||||
"description": "An electron-vue project",
|
"description": "An electron-vue project",
|
||||||
"license": null,
|
"license": null,
|
||||||
|
@ -1,4 +1,14 @@
|
|||||||
import {app, nativeImage, BrowserWindow, clipboard, globalShortcut, ipcMain, Notification, screen, TouchBar} from "electron";
|
import {
|
||||||
|
app,
|
||||||
|
nativeImage,
|
||||||
|
BrowserWindow,
|
||||||
|
clipboard,
|
||||||
|
globalShortcut,
|
||||||
|
ipcMain,
|
||||||
|
Notification,
|
||||||
|
screen,
|
||||||
|
TouchBar
|
||||||
|
} from 'electron';
|
||||||
import {exec, spawn} from "child_process";
|
import {exec, spawn} from "child_process";
|
||||||
import robot from "robotjs";
|
import robot from "robotjs";
|
||||||
import Api from "./api";
|
import Api from "./api";
|
||||||
@ -364,6 +374,7 @@ class Listener {
|
|||||||
windowMoveInit(win) {
|
windowMoveInit(win) {
|
||||||
let hasInit = false;
|
let hasInit = false;
|
||||||
ipcMain.on('window-move', () => {
|
ipcMain.on('window-move', () => {
|
||||||
|
let bounds = win.getBounds();
|
||||||
if (!hasInit) {
|
if (!hasInit) {
|
||||||
hasInit = true;
|
hasInit = true;
|
||||||
ioHook.start(false);
|
ioHook.start(false);
|
||||||
@ -377,8 +388,9 @@ class Listener {
|
|||||||
const cursorPosition = screen.getCursorScreenPoint();
|
const cursorPosition = screen.getCursorScreenPoint();
|
||||||
const dx = winStartPosition.x + cursorPosition.x - mouseStartPosition.x;
|
const dx = winStartPosition.x + cursorPosition.x - mouseStartPosition.x;
|
||||||
const dy = winStartPosition.y + cursorPosition.y - mouseStartPosition.y;
|
const dy = winStartPosition.y + cursorPosition.y - mouseStartPosition.y;
|
||||||
let {x, y} = {x: dx, y: dy};
|
bounds.x = parseInt(dx);
|
||||||
win.setPosition(parseInt(x), parseInt(y));
|
bounds.y = parseInt(dy);
|
||||||
|
win.setBounds(bounds);
|
||||||
});
|
});
|
||||||
|
|
||||||
ioHook.on('mouseup', e => {
|
ioHook.on('mouseup', e => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user