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