pyloid 0.12.0__tar.gz → 0.12.1__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyloid
3
- Version: 0.12.0
3
+ Version: 0.12.1
4
4
  Summary:
5
5
  Author: aesthetics-of-record
6
6
  Author-email: 111675679+aesthetics-of-record@users.noreply.github.com
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pyloid"
3
- version = "0.12.0"
3
+ version = "0.12.1"
4
4
  description = ""
5
5
  authors = ["aesthetics-of-record <111675679+aesthetics-of-record@users.noreply.github.com>"]
6
6
  readme = "README.md"
@@ -15,6 +15,7 @@ from PySide6.QtGui import (
15
15
  QClipboard,
16
16
  QImage,
17
17
  QAction,
18
+ QCursor,
18
19
  )
19
20
  from PySide6.QtCore import Qt, Signal, QPoint, QUrl, QObject, QTimer, QSize, QEvent
20
21
  from PySide6.QtNetwork import QLocalServer, QLocalSocket
@@ -261,6 +262,7 @@ class CustomWebEngineView(QWebEngineView):
261
262
  self.parent = parent
262
263
  self.drag_relative_position = None
263
264
  self.is_dragging = False
265
+ self.screen_geometry = self.screen().availableGeometry()
264
266
 
265
267
  def mouse_press_event(self, event):
266
268
  if event.button() == Qt.LeftButton:
@@ -273,8 +275,25 @@ class CustomWebEngineView(QWebEngineView):
273
275
  if not self.parent.frame and self.is_dragging:
274
276
  # 현재 마우스 위치를 전역 좌표로 가져옵니다
275
277
  current_global_pos = event.globalPos()
276
- # 새로운 창 위치를 계산합니다
277
- new_window_pos = current_global_pos - self.drag_relative_position
278
+
279
+ # 화면 경계를 계산합니다
280
+ left_boundary = self.screen_geometry.left()
281
+ right_boundary = self.screen_geometry.right()
282
+ top_boundary = self.screen_geometry.top()
283
+ bottom_boundary = self.screen_geometry.bottom()
284
+
285
+ # 마우스 커서 위치를 제한합니다
286
+ new_cursor_pos = QPoint(
287
+ max(left_boundary, min(current_global_pos.x(), right_boundary)),
288
+ max(top_boundary, min(current_global_pos.y(), bottom_boundary)),
289
+ )
290
+
291
+ # 마우스 커서를 새 위치로 이동합니다
292
+ QCursor.setPos(new_cursor_pos)
293
+
294
+ # 창의 새 위치를 계산합니다
295
+ new_window_pos = new_cursor_pos - self.drag_relative_position
296
+
278
297
  # 창을 새 위치로 이동합니다
279
298
  self.parent._window.move(new_window_pos)
280
299
 
@@ -283,12 +302,13 @@ class CustomWebEngineView(QWebEngineView):
283
302
  self.is_dragging = False
284
303
 
285
304
  def eventFilter(self, source, event):
286
- if self.focusProxy() is source and event.type() == QEvent.MouseButtonPress:
287
- self.mouse_press_event(event)
288
- if self.focusProxy() is source and event.type() == QEvent.MouseMove:
289
- self.mouse_move_event(event)
290
- elif self.focusProxy() is source and event.type() == QEvent.MouseButtonRelease:
291
- self.mouse_release_event(event)
305
+ if self.focusProxy() is source:
306
+ if event.type() == QEvent.MouseButtonPress:
307
+ self.mouse_press_event(event)
308
+ elif event.type() == QEvent.MouseMove:
309
+ self.mouse_move_event(event)
310
+ elif event.type() == QEvent.MouseButtonRelease:
311
+ self.mouse_release_event(event)
292
312
  return super().eventFilter(source, event)
293
313
 
294
314
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes