[kwin] [Bug 474686] Setting a value to Clipboard via a button in an unfocused window does not work.

2024-06-04 Thread David Edmundson
https://bugs.kde.org/show_bug.cgi?id=474686

David Edmundson  changed:

   What|Removed |Added

 Status|REPORTED|RESOLVED
 Resolution|--- |FIXED
 CC||k...@davidedmundson.co.uk

--- Comment #4 from David Edmundson  ---
Kwin now allows any app to change clipboard without focus.

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

[kwin] [Bug 474686] Setting a value to Clipboard via a button in an unfocused window does not work.

2023-09-21 Thread zhangtingan
https://bugs.kde.org/show_bug.cgi?id=474686

--- Comment #3 from zhangtin...@uniontech.com  ---
Created attachment 161774
  --> https://bugs.kde.org/attachment.cgi?id=161774&action=edit
demo

Run the demo, let the input focus on any application, click the button in the
demo, it will output an "ok" at the other application's focus. But it won't
actually

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

[kwin] [Bug 474686] Setting a value to Clipboard via a button in an unfocused window does not work.

2023-09-20 Thread zhangtingan
https://bugs.kde.org/show_bug.cgi?id=474686

--- Comment #2 from zhangtin...@uniontech.com  ---
(In reply to Vlad Zahorodnii from comment #1)
> It's a lazy way to determine that the passed serial is valid. Only focused
> client is going to have a serial that can be used to set the selection.
> 
> > Create a Qt window, set the `Qt::WindowDoesNotAcceptFocus` property
> 
> As far as I know, an xdg_toplevel cannot influence whether it should accept
> focus or not. It can only change the input shape, but it's controlled by a
> different flag.

yes, i found that `Only focusedclient is going to have a serial that can be
used to set the selection`.
But I don't really understand what you mean by this, so let me describe my
problem in detail.

I have written a program through which I want to click a button to enter data
for another application.

The way it works now is: create a window set the `Qt::WindowStaysOnTopHint
|Qt::WindowDoesNotAcceptFocus` property so that the window stays on top and the
input focus is retained in the other program, then click the button and via
`QClipboard->setText` put the data into the `selection` in the system by
`QClipboard->setText`. However, I find that the following code in `kwayland`
does not work at this point.

`QObject::connect(dataDevice, &DataDeviceInterface::selectionChanged, q, [this,
dataDevice]], [this, dataDevice]].
[this, dataDevice] {
if(keys.focus.surface && dataDevice && dataDevice->client() ==
keys.focus.surface->client()) {
updateSelection(dataDevice->selection(), true);
}
}
);`

When I call `setText` in my Qt app, `setSelection` is called in wayland, which
then triggers Kwayland's callback function, but at this point, the source of
the data is the program I've written, but keys.focus.surface is another app,
causing the selection not to be updated.

Maybe the kwin in my system has been modified, resulting in a difference from
the original design.

I will also try to test this on a native KDE system, and if necessary, I'll
attach a demo I've written!

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

[kwin] [Bug 474686] Setting a value to Clipboard via a button in an unfocused window does not work.

2023-09-19 Thread Vlad Zahorodnii
https://bugs.kde.org/show_bug.cgi?id=474686

--- Comment #1 from Vlad Zahorodnii  ---
It's a lazy way to determine that the passed serial is valid. Only focused
client is going to have a serial that can be used to set the selection.

> Create a Qt window, set the `Qt::WindowDoesNotAcceptFocus` property

As far as I know, an xdg_toplevel cannot influence whether it should accept
focus or not. It can only change the input shape, but it's controlled by a
different flag.

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

[kwin] [Bug 474686] Setting a value to Clipboard via a button in an unfocused window does not work.

2023-09-19 Thread Nate Graham
https://bugs.kde.org/show_bug.cgi?id=474686

Nate Graham  changed:

   What|Removed |Added

 CC||n...@kde.org

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