Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
c14b291b by wurstsalat at 2026-01-26T20:49:51+01:00
fix: Preview: Set drag hotspot to upper left corner for better UX
Fixes #12599
- - - - -
1 changed file:
- gajim/gtk/preview/preview.py
Changes:
=====================================
gajim/gtk/preview/preview.py
=====================================
@@ -120,9 +120,6 @@ def __init__(
self._http_obj = None
self._state = PreviewState.INIT
- self._drag_hotspot_x: float = 0
- self._drag_hotspot_y: float = 0
-
drag_source = Gtk.DragSource(actions=Gdk.DragAction.COPY)
self._connect(drag_source, "prepare", self._on_drag_prepare)
self._connect(drag_source, "drag-begin", self._on_drag_begin)
@@ -210,9 +207,6 @@ def _on_drag_prepare(
if self._state not in (PreviewState.DOWNLOADED, PreviewState.DISPLAY):
return None
- self._drag_hotspot_x = x
- self._drag_hotspot_y = y
-
value = GObject.Value()
value.init(PreviewWidget)
value.set_object(self)
@@ -223,8 +217,8 @@ def _on_drag_begin(self, _drag_source: Gtk.DragSource,
drag: Gdk.Drag) -> None:
Gtk.DragIcon.set_from_paintable(
drag,
Gtk.WidgetPaintable().new(self),
- hot_x=int(self._drag_hotspot_x),
- hot_y=int(self._drag_hotspot_y),
+ hot_x=0,
+ hot_y=0,
)
app.window.highlight_dnd_targets(self, True)
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/c14b291bdbae14544cdc370bb9faca90cb7b2cda
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/c14b291bdbae14544cdc370bb9faca90cb7b2cda
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]