Regression: Drag and Drop seems to be broken for image files from desktop #100899

Closed
opened 2022-09-08 04:50:28 +02:00 by Christopher Choo · 34 comments

Operating system: Mac OS
Graphics card: Apple M1 Pro 16 core

Broken: 3.30, caused by bbf87c4f75
Worked: 3.2.2, bcfdb14560, master, 2022-08-29

I can no longer drag and drop image textures from my desktop into blender when using two monitors.

Steps to reproduce

  • Open blender on external monitor
  • Fullscreen blender

Drag image into some editor (that supports it)

It does not work...
Drag and drop still works when blender is on left side of Main display

Operating system: Mac OS Graphics card: Apple M1 Pro 16 core Broken: 3.30, caused by bbf87c4f75 Worked: 3.2.2, bcfdb14560e7, master, 2022-08-29 I can no longer drag and drop image textures from my desktop into blender when using two monitors. **Steps to reproduce** - Open blender on external monitor - Fullscreen blender # Drag image into some editor (that supports it) It does not work... Drag and drop still works when blender is on left side of Main display

Added subscriber: @C22Raptor

Added subscriber: @C22Raptor

#101184 was marked as duplicate of this issue

#101184 was marked as duplicate of this issue

#101064 was marked as duplicate of this issue

#101064 was marked as duplicate of this issue

#101033 was marked as duplicate of this issue

#101033 was marked as duplicate of this issue

#100938 was marked as duplicate of this issue

#100938 was marked as duplicate of this issue
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Thanks for the report. Do you run Blender as administrator? Doing so will not allow to drag and drop images

Thanks for the report. Do you run Blender as administrator? Doing so will not allow to drag and drop images

I never changed any run settings for blender, I just opened it up after installing.

I never changed any run settings for blender, I just opened it up after installing.

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'
Member

Added subscribers: @Piergiorgio_PG, @OmarEmaraDev

Added subscribers: @Piergiorgio_PG, @OmarEmaraDev
Member

Added subscriber: @mano-wii

Added subscriber: @mano-wii
Member

@mano-wii Can you give this a try on Mac?

@mano-wii Can you give this a try on Mac?

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

I think I can reproduce, though not quite sure if this is same as reported issue - files dragged to any editor are added with offset to the left. So if I drag file to centre of the screen nothing is added.

Operating system: macOS-12.2.1-x86_64-i386-64bit 64 Bits
Graphics card: AMD Radeon Pro 5700 XT OpenGL Engine ATI Technologies Inc. 4.1 ATI-4.7.10

I think I can reproduce, though not quite sure if this is same as reported issue - files dragged to any editor are added with offset to the left. So if I drag file to centre of the screen nothing is added. Operating system: macOS-12.2.1-x86_64-i386-64bit 64 Bits Graphics card: AMD Radeon Pro 5700 XT OpenGL Engine ATI Technologies Inc. 4.1 ATI-4.7.10

Added subscriber: @UseTheFarce

Added subscriber: @UseTheFarce

This issue was referenced by 81ec5ec366

This issue was referenced by 81ec5ec36651af6bc2c0f64c57add589facefef2

This issue was referenced by 5f4db28c24

This issue was referenced by 5f4db28c24943586536e6cc253756805ed9ed722

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Germano Cavalcante changed title from Drag and Drop seems to be broken for image files from desktop to Regression: Drag and Drop seems to be broken for image files from desktop 2022-09-14 04:50:19 +02:00
Campbell Barton self-assigned this 2022-09-14 08:23:57 +02:00

The problem is that, unlike other OSs, on Mac GHOST_TEventDragnDropData::x/y are in "the base coordinate system of the destination object’s window". Converting to screen coordinates seems to fix the problem.

diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index c247ef3daa0..5562db7d67f 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -1123,6 +1123,7 @@ - (void)windowWillClose:(NSNotification *)notification
     case GHOST_kEventDraggingEntered:
     case GHOST_kEventDraggingUpdated:
     case GHOST_kEventDraggingExited:
+      window->clientToScreenIntern(mouseX, mouseY, mouseX, mouseY);
       pushEvent(new GHOST_EventDragnDrop(
           getMilliSeconds(), eventType, draggedObjectType, window, mouseX, mouseY, NULL));
       break;
@@ -1331,6 +1332,8 @@ - (void)windowWillClose:(NSNotification *)notification
           return GHOST_kFailure;
           break;
       }
+
+      window->clientToScreenIntern(mouseX, mouseY, mouseX, mouseY);
       pushEvent(new GHOST_EventDragnDrop(
           getMilliSeconds(), eventType, draggedObjectType, window, mouseX, mouseY, eventData));
 

But I'm not familiar with this API.
Maybe you can get the screen coordinates from the beginning.
And I'm not sure if we should use draggingDestinationWindow instead the GHOST_Window.

The problem is that, unlike other OSs, on Mac `GHOST_TEventDragnDropData::x/y` are in "the base coordinate system of the destination object’s window". Converting to screen coordinates seems to fix the problem. ``` diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index c247ef3daa0..5562db7d67f 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -1123,6 +1123,7 @@ - (void)windowWillClose:(NSNotification *)notification case GHOST_kEventDraggingEntered: case GHOST_kEventDraggingUpdated: case GHOST_kEventDraggingExited: + window->clientToScreenIntern(mouseX, mouseY, mouseX, mouseY); pushEvent(new GHOST_EventDragnDrop( getMilliSeconds(), eventType, draggedObjectType, window, mouseX, mouseY, NULL)); break; @@ -1331,6 +1332,8 @@ - (void)windowWillClose:(NSNotification *)notification return GHOST_kFailure; break; } + + window->clientToScreenIntern(mouseX, mouseY, mouseX, mouseY); pushEvent(new GHOST_EventDragnDrop( getMilliSeconds(), eventType, draggedObjectType, window, mouseX, mouseY, eventData)); ``` But I'm not familiar with this API. Maybe you can get the screen coordinates from the beginning. And I'm not sure if we should use `draggingDestinationWindow` instead the `GHOST_Window`.

@mano-wii checking over intern/ghost/intern/GHOST_WindowCocoa.mm it seems these coordinates are provided by macOS, although I suppose their might be a way to request screen-coordinates. If the fix works then I think it's reasonable commit.


Note that as this error is in 3.3 release, suggest to revert bbf87c4f75 there, and apply the fix from @mano-wii in master.

@mano-wii checking over `intern/ghost/intern/GHOST_WindowCocoa.mm` it seems these coordinates are provided by macOS, although I suppose their might be a way to request screen-coordinates. If the fix works then I think it's reasonable commit. ---- Note that as this error is in 3.3 release, suggest to revert bbf87c4f75 there, and apply the fix from @mano-wii in master.
Member

Added subscriber: @BGreenstone

Added subscriber: @BGreenstone

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'

Sorry if this arrives late: I'd suggest to check the solution on a multimonitor setup, too, as I'm seeing a different behavior of the bug depending on which monitor the File Browser is in.

For example, if the FIle Browser is brought to a monitor different to the one Blender was launched in, drag and drop stops working completely, no matter what half of that screen it is set in.

Also, older systems such as macOS 10.14 Mojave can work with the Spaces feature (virtual desktops) on or off (I'm not sure if they are still optional in recent macOSes). That might be complicating things.

Sorry if this arrives late: I'd suggest to check the solution on a multimonitor setup, too, as I'm seeing a different behavior of the bug depending on which monitor the File Browser is in. For example, if the FIle Browser is brought to a monitor different to the one Blender was launched in, drag and drop stops working completely, no matter what half of that screen it is set in. Also, older systems such as macOS 10.14 Mojave can work with the Spaces feature (virtual desktops) on or off (I'm not sure if they are still optional in recent macOSes). That might be complicating things.

Added subscriber: @juan-20

Added subscriber: @juan-20

I just realized that I never mentioned that I work on two displays(sorry this was my first bug report so my bad there). @juan-20 Gómez (UseTheFarce) gave a better example of my specific case. Dragging and dropping items from my desktop on my Mac to my external monitor results in nothing happening, despite drag and drop working on my Mac's display. Again, sorry for not explaining properly.

I just realized that I never mentioned that I work on two displays(sorry this was my first bug report so my bad there). @juan-20 Gómez (UseTheFarce) gave a better example of my specific case. Dragging and dropping items from my desktop on my Mac to my external monitor results in nothing happening, despite drag and drop working on my Mac's display. Again, sorry for not explaining properly.

@C22Raptor could you check to see that the recently included fix works for you on multiple monitors? (try a daily build).

@C22Raptor could you check to see that the recently included fix works for you on multiple monitors? (try a daily build).

@Campbell Barton (campbellbarton) I tried the most recent apple silicon build from sep 15th and it still seems to be broken.

@Campbell Barton (campbellbarton) I tried the most recent apple silicon build from sep 15th and it still seems to be broken.

@C22Raptor what is the SHA1 (commit hash?), to be sure this includes the recent fix.

@C22Raptor what is the SHA1 (commit hash?), to be sure this includes the recent fix.

@Campbell Barton (campbellbarton) The hash is 19ae71c113

@Campbell Barton (campbellbarton) The hash is 19ae71c11342

@C22Raptor please check a daily build of Blender 3.4.0 - Alpha.

@C22Raptor please check a daily build of `Blender 3.4.0 - Alpha`.

@Campbell Barton (campbellbarton) Drag and drop seems to work on the latest 3.4 alpha build with a second monitor

@Campbell Barton (campbellbarton) Drag and drop seems to work on the latest 3.4 alpha build with a second monitor

Added subscriber: @AlexMelkin

Added subscriber: @AlexMelkin
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
8 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#100899
No description provided.