screenedge: Allow certain actions during drag and drop
Most actions do not handle drag and drop properly yet (e.g. entering the overview during drag and drop is just very broken), at least allow "show desktop" and "application launcher". This allows to easily drag a file onto the desktop by starting a drag, nudging the "show desktop" screen edge and dropping it on the desktop.
This commit is contained in:
parent
b5fb9db369
commit
40fcce83ba
1 changed files with 12 additions and 4 deletions
|
@ -28,6 +28,8 @@
|
||||||
#include "pointer_input.h"
|
#include "pointer_input.h"
|
||||||
#include "utils/common.h"
|
#include "utils/common.h"
|
||||||
#include "virtualdesktops.h"
|
#include "virtualdesktops.h"
|
||||||
|
#include "wayland/seat.h"
|
||||||
|
#include "wayland_server.h"
|
||||||
#include <workspace.h>
|
#include <workspace.h>
|
||||||
#include <x11window.h>
|
#include <x11window.h>
|
||||||
// DBus generated
|
// DBus generated
|
||||||
|
@ -221,10 +223,16 @@ bool Edge::activatesForPointer() const
|
||||||
{
|
{
|
||||||
bool isMovingWindow = false;
|
bool isMovingWindow = false;
|
||||||
|
|
||||||
// Don't activate edge when a mouse button is pressed, except when
|
// Most actions do not handle drag and drop properly yet
|
||||||
// moving a window. Dragging a scroll bar all the way to the edge
|
// but at least allow "show desktop" and "application launcher".
|
||||||
// shouldn't activate the edge.
|
if (waylandServer() && waylandServer()->seat()->isDragPointer()) {
|
||||||
if (input()->pointer()->areButtonsPressed()) {
|
if (!m_edges->isDesktopSwitching() && m_action != ElectricActionShowDesktop && m_action != ElectricActionApplicationLauncher) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// Don't activate edge when a mouse button is pressed, except when
|
||||||
|
// moving a window. Dragging a scroll bar all the way to the edge
|
||||||
|
// shouldn't activate the edge.
|
||||||
|
} else if (input()->pointer()->areButtonsPressed()) {
|
||||||
auto c = Workspace::self()->moveResizeWindow();
|
auto c = Workspace::self()->moveResizeWindow();
|
||||||
if (!c || c->isInteractiveResize()) {
|
if (!c || c->isInteractiveResize()) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue