]> git.eshelyaron.com Git - emacs.git/commitdiff
Use cached monitor info during DND if available
authorPo Lu <luangruo@yahoo.com>
Sun, 12 Jun 2022 02:17:19 +0000 (10:17 +0800)
committerPo Lu <luangruo@yahoo.com>
Sun, 12 Jun 2022 02:17:19 +0000 (10:17 +0800)
* src/xterm.c (x_dnd_begin_drag_and_drop): Use previously cached
monitor attributes if they exist.

src/xterm.c

index f422fc9d4011cab3258a30a7d1bc3a8154994fe2..e282856374d0d701018bea090de359578f3e65b3 100644 (file)
@@ -10988,8 +10988,15 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
 
   if (follow_tooltip)
     {
+#if defined HAVE_XRANDR || defined USE_GTK
       x_dnd_monitors
-       = Fx_display_monitor_attributes_list (frame);
+       = FRAME_DISPLAY_INFO (f)->last_monitor_attributes_list;
+
+      if (NILP (x_dnd_monitors))
+#endif
+       x_dnd_monitors
+         = Fx_display_monitor_attributes_list (frame);
+
       record_unwind_protect_void (x_clear_dnd_monitors);
     }