https://bugs.kde.org/show_bug.cgi?id=520777

            Bug ID: 520777
           Summary: "Move to Current Desktop" is broken with grouped tasks
    Classification: Plasma
           Product: plasmashell
      Version First 6.6.91
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Task Manager and Icons-Only Task Manager widgets
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: 1.0

DESCRIPTION

Whenever you right-click a grouped task, you get a scary log message:

Could not find any constructor for value type QQmlRectValueType to call with
value undefined
"Could not convert argument 0 from undefined to QRect"
        
"@qrc:/qt/qml/plasma/applet/org/kde/plasma/taskmanager/ContextMenu.qml:325"
        
"refresh@qrc:/qt/qml/plasma/applet/org/kde/plasma/taskmanager/ContextMenu.qml:324"
         "expression for
onCompleted@qrc:/qt/qml/plasma/applet/org/kde/plasma/taskmanager/ContextMenu.qml"
        
"createContextMenu@qrc:/qt/qml/plasma/applet/org/kde/plasma/taskmanager/main.qml:548"
        
"showContextMenu@qrc:/qt/qml/plasma/applet/org/kde/plasma/taskmanager/Task.qml:296"
         "expression for
onLongPressed@qrc:/qt/qml/plasma/applet/org/kde/plasma/taskmanager/Task.qml:396"
         "expression for
onTriggered@qrc:/qt/qml/plasma/applet/org/kde/plasma/taskmanager/Task.qml"
qrc:/qt/qml/plasma/applet/org/kde/plasma/taskmanager/ContextMenu.qml:325:
TypeError: Passing incompatible arguments to C++ functions from JavaScript is
not allowed.

Also, clicking "Move to Current Desktop" from the "Move To Desktop" submenu
does nothing except print a similar message.

The reason for both is ultimately the same: TaskGroupingProxyModel does not
return anything for the ScreenGeometry role (a comment says that this is not
implemented because nothing needs this yet). So when trying to find the current
desktop of the task (by screen geometry) to see if the action should be
enabled, we fail when trying to convert undefined to QRect, and similarly when
clicking it to figure out where to move it. 

Implementing ScreenGeometry in this case shouldn't be too difficult in
principle. But I'm a bit unsure about what the correct behavior should be.

Say we're on VD1 on screen 1 and VD2 on screen 2; a grouped task has two
windows on VD3, W1 on screen 1 and W2 on screen 2. What should happen if we
click "Move to Current Desktop"?

It would seem to me that it should move W1 to VD1 and W2 to VD2, after thinking
about it, but I'm not sure.

But this wouldn't work (naively) with our current requestVirtualDesktops
semantics - requestVirtualDesktops(index, desktops) moves the window to all of
the virtual desktops specified (at least on Wayland), not the first to the
first entry in desktops, the second to the second etc. To get that, we'd have
to add a new backend method, or iterate through the model on the qml side. (And
this is all a bit hard to reason about, so I'm not sure about all of the
possible edge cases).

I'm also not sure how useful this is, and whether it's worth the effort and
complexity. We could consider disabling/not adding the menu entry on grouped
tasks generally, or on grouped tasks with per-screen VDs enabled (if we can
figure this out from libtaskmanager?), or based on whatever criteria.

I don't really use multiple screens and independent VDs, so I have no idea.

STEPS TO REPRODUCE
1. Have a grouped task
2. Right-click the task
3.  click Move to Desktop > Move to Current Desktop (To see that it does
nothing, go to a VD the task is not on, and make sure you have the task manager
show entries on all desktops)

OBSERVED RESULT

Error message, clicking it does nothing

EXPECTED RESULT

At least no error message. I'm not sure what exactly if and what it should do,
but if it's clickable, it should do something.

SOFTWARE/OS VERSIONSOperating System: Fedora Linux 44
KDE Plasma Version: 6.7.80
KDE Frameworks Version: 6.27.0
Qt Version: 6.11.1
Kernel Version: 7.0.10-201.fc44.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-6200U CPU @ 2.30GHz
Memory: 16 GiB of RAM (15.5 GiB usable)
Graphics Processor: Intel® HD Graphics 520


ADDITIONAL INFORMATION

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to