Bug 449073 - WebEngine KPart does not accept drag'n'drop on main view area
Summary: WebEngine KPart does not accept drag'n'drop on main view area
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: webenginepart (show other bugs)
Version: 21.08.2
Platform: Debian unstable Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-24 12:42 UTC by Marcel Partap
Modified: 2022-11-06 14:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel Partap 2022-01-24 12:42:52 UTC
A very useful technique (many years back) to check a list of links used to be to split a konqueror window into two views, then dragging links from one view to the other sequentially. This doesn't work anymore with the WebEngine KPart because it does not accept link drops on its main view area.
None of the other browser seem to support (arbitrarily!) splitting a window into sub-views, so instead of that simple work-flow to sequentially check links, opening tabs is the dominant method bringing in the scourge of tab overkill into most IT persons life. Oh please someone make this work again .. 😁
Comment 1 Bug Janitor Service 2022-01-30 17:51:22 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/konqueror/-/merge_requests/107
Comment 2 Bug Janitor Service 2022-05-17 11:56:33 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/konqueror/-/merge_requests/117
Comment 3 Stefano Crocco 2022-07-09 16:40:43 UTC
Git commit 75407f8da4c31f81a6138b9c1ea18cb37aa5bb6a by Stefano Crocco.
Committed on 09/07/2022 at 16:26.
Pushed by stefanocrocco into branch 'master'.

Allow to open URLs by dragging it in WebEnginePart

M  +36   -0    webenginepart/src/webengineview.cpp
M  +30   -0    webenginepart/src/webengineview.h

https://invent.kde.org/network/konqueror/commit/75407f8da4c31f81a6138b9c1ea18cb37aa5bb6a
Comment 4 Marcel Partap 2022-10-07 20:13:28 UTC
Hey Stefano, thanks a lot for implementing that! 😀
For me though, links dropped on a split view will open in a new tab, not in that view.
I assume it doesn't for you?
Comment 5 Stefano Crocco 2022-10-07 20:21:17 UTC
When I implemented it, the page was opened in the split view; however, I tested it with the current version and it behaves as you said, opening the page in a new tab. I'll look into it as soon as I have time
Comment 6 Bug Janitor Service 2022-10-09 13:17:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/konqueror/-/merge_requests/143
Comment 7 Stefano Crocco 2022-10-09 13:25:39 UTC
Unfortunately, the behavior you noticed is caused by  change in QtWebEngine which happened, as far as I can understand, in Qt 5.15.5. Before that, it ignored remote URLs dragged on a page, which left Konqueror free to decide what to do with them. In the new version, instead, remote URLs are opened by QtWebEngine itself and it always opens it in a new tab, without giving Konqueror the ability to change this behavior. I have found a way to work around this limitation and having the URLs to be opened in the view where they were dragged to: however, the workaround is quite fragile and I'm not sure it won't break, so I can promise it'll be accepted.
Comment 8 Stefano Crocco 2022-11-06 14:15:17 UTC
Git commit 9f1e9d8a6a4a99ed51a83384c0aecbc1c218ec1c by Stefano Crocco.
Committed on 06/11/2022 at 14:15.
Pushed by stefanocrocco into branch 'master'.

Fix the behavior of dropping an URL on a WebEngineView with Qt 5.15.5

In versions of Qt before 5.15.5 QWebEngineView didn't allow to open
remote URLs by dropping them. With Qt 5.15.5, instead, they're always
opened in a new tab. This restore the old behavior of opening them in
the view where they have been dropped (unlike before, this also happens
for local URLs).

Since QtWebEngine doesn't provide a way to change its behavior and that
we can't completely override it because we can't know, for example, if
the URL has been dropped on the area for uploading a file, we have to
use a timer with an arbitrary value during which
WebEnginePage::createWindow returns the page itself instead of creating
a new page.

M  +6    -0    webenginepart/src/CMakeLists.txt
M  +23   -0    webenginepart/src/webenginepage.cpp
M  +39   -1    webenginepart/src/webenginepage.h
M  +18   -6    webenginepart/src/webengineview.cpp
M  +39   -11   webenginepart/src/webengineview.h

https://invent.kde.org/network/konqueror/commit/9f1e9d8a6a4a99ed51a83384c0aecbc1c218ec1c