summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add Pointer Lock supportSzabolcs David2015-01-161-0/+10
| | | | | | | | | | While the mouse is locked, the cursor is hidden from the user and mouse events are still generated. The movement which is reported by the event indicates what would be the position change if the mouse would not have been locked. Change-Id: I79b3df5d7d644cd675a27e6c5a0da54e00b69da3 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* Support TransferableResource::is_softwareJocelyn Turcotte2014-11-251-0/+5
| | | | | | | | | | | | | | When the GPU process fails to initialize, or when the --disable-gpu switch is provided, the delegating renderer will transfer resource mailboxes through shared memory pixel data instead of through shared texture IDs in the GPU process. Handle this by uploading the pixel data ourselves with createTextureFromImage, also allowing us to render tiles in the QtQuick 2D Renderer. Change-Id: I70ad7122cd0e52dd5ab435ae01e7f032b8e1194e Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Avoid relying on QOpenGL classes to handle RenderPassesJocelyn Turcotte2014-11-251-1/+14
| | | | | | | | | | | | | | | | | | | Use QSGLayer and get rid of RenderPassTexture so that we can render intermediate layers with the QtQuick 2D Renderer. This reintroduces the private dependency on QtQuick since the QSGLayer factory methods aren't available publically, and also that we need to use QSGImageNode instead of QSGSimpleTextureNode to use them. Since we can't subclass QSGLayer to hold a reference to SG objects directly in the nodes that use them, store them all in the wrapping DelegatedFrameNode in a SGObjects structs. This works assuming that the DelegatedFrameNode will always be at the root of our nodes, layers and textures; if the scene graph destroys the DelegatedFrameNode all child nodes will be destroyed with it. Change-Id: Iedeceb8f98eb54fd8228a677c366d6df9a270e11 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Replace QStringLiteral with QLatin1String where appropriateKai Koehne2014-10-071-1/+1
| | | | | | | | | It's faster to use QLatin1String in places where we don't actually need a QString object (like for comparison, or when creating a string with QStringBuilder). Change-Id: I9b8e28040dc2b79a767e15015b85822d06141bbe Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Fix issues on HiDPI displaysAndras Becsi2014-09-241-2/+3
| | | | | | | | | | | This patch fixes widgets rendering on HiDPI displays and notifies about the a potential device pixel ratio change when the window is moved. This addresses the blurriness when a web view is moved between an attached LoDPI screen and HiDPI screen resulting from the device pixel ratio not being updated. Change-Id: I97af0199c07deac8bbe4688c665aaa6df1608ae9 Reviewed-by: Michael Bruning <michael.bruning@digia.com>
* [OSX] Buildfix: Classes used with templates must be fully qualified.Zeno Albisser2014-08-211-0/+1
| | | | | Change-Id: Idf1cd3990e2cfd9e2ed3b017370e689c1126bb48 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Update License Headers for Qt WebEngine to LGPLv3.Zeno Albisser2014-08-211-15/+10
| | | | | | | Change-Id: Idbe0eafb51d77cc00e3a93179b81770724d5bfaa Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com> Reviewed-by: Tuukka Turunen <tuukka.turunen@digia.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Propagate the page's screen coordinates when the top-level window movedJocelyn Turcotte2014-08-201-0/+21
| | | | | | | | | | | | | | | | This fixes a regression after the 37 upgrade where the select popups would have the wrong position. Adjust to the new behavior and also avoid doing a mapToGlobal of the position received in InitAsPopup. RWHV::SetBounds has been giving us screen coordinates since the Chromium 33 update, but popup locations somehow managed to work properly through some side-effect sorcery. This also fixes the value of window.screen[XY] in JavaScript which wasn't updated when the window was moved. Change-Id: I544499bafedccfb7d389b4abc48f1386c398473f Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Use QSGEngine instead of the private QSGRenderContextJocelyn Turcotte2014-08-061-22/+20
| | | | | | | | | QSGEngine was added in Qt 5.4 to allow using the scene graph without QQuickWindow. Use it for our FBO as well as for the QOpenGLWidget rendering. Change-Id: If4665d4f33c9dad69d2d4269309163bb5ffbd8e3 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Switch to the public QOpenGLWidget APILaszlo Agocs2014-08-021-0/+12
| | | | | Change-Id: I5554e43b8703864111f37f8b684a47669107512e Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix tab focus in the widgets and QML webviewsJocelyn Turcotte2014-08-011-1/+2
| | | | | | | | | | | | | | | | | | | | Fixes: - Make sure that we call SetInitialFocus when giving focus through Tab This does the same as would WebContents::FocusThroughTabTraversal - Implement QWebEnginePagePrivate::passOnFocus - Set each new RWHVQtDelegate as the focus proxy of the QWebEngineView - Make sure that the widgets delegate accepts the tab focus policy Cleaups: - RenderWidgetHostViewQtDelegateQuick doesn't need to be a focus scope, it doesn't have any children - We don't need to reimplement QQuickWebEngineView::forceActiveFocus since the view is now a focus scope - Do not explicitly setFocus(true) on the QQuickWebEngineView, the application should decide this through the API Change-Id: I817dc2c895d4fff4aa3536c71ecc5d306bb3bee0 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix RenderWidgetHostViewQt::GetViewBoundsFrederik Gladhorn2014-07-141-0/+6
| | | | | | | | | | GetViewBounds should return the bounds of the view, not the screen rect. The view bounds are for example used to calculate the screen position of accessible objects (which gets fixed with this patch). Change-Id: I5b342113af737847c1756a13183cd2b8b8db648a Reviewed-by: Andras Becsi <andras.becsi@digia.com> Reviewed-by: Michael Bruning <michael.bruning@digia.com>
* Avoid black flashes when showing a new QWebEngineViewJocelyn Turcotte2014-05-281-1/+1
| | | | | | | | | | | | | | QPlatformBackingStore still doesn't enable blending when compositing a QOpenGLWidget with the rest of the widget tree. This means that a tranparent pixel will show as black. Until we get to properly go through the work of making it possible to render a transparent webview, set the glClear color to white in order to avoid seeing any black background before we get our first frame from Chromium. Change-Id: Idf7bb831a3b0d62b02f2527e2a15d830bf1e8ad4 Reviewed-by: Michael Bruning <michael.bruning@digia.com>
* [Widgets] Tooltip word wrap fixupPierre Rossi2014-05-161-1/+6
| | | | | | | | | | | QTooltip's documentation states that "rich text displayed in a tool tip is implicitly word-wrapped". This seems to be a more desirable behavior for our needs. To mitigate any potential malicious tooltip contents, we escape any eventual html entities, and truncate to a reasonable size. Change-Id: Iae3ea80e7660840aae39d228d1177dcc56f4a032 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Fix double clicks needing three presses in QWebEngineViewJocelyn Turcotte2014-05-081-1/+14
| | | | | | | | | | | | | | Since Qt 5.3 QWidget has the same behavior as Qt 4 where it will replace a second MouseButtonPress event with a MouseButtonDblClick instead of sending both. Fix the issue by moving the MouseButtonDblClick ignore code up to the QtQuick code, assume that upper layers will not send MouseButtonDblClick events, and re-replace the MouseButtonDblClick event with a MouseButtonPress in the QtWidgets code. Change-Id: I529dad2de538f486b00eb900ea6d2ed849a3b1f0 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Properly cleanup the old page when attaching a new oneJocelyn Turcotte2014-05-071-0/+5
| | | | | | | | | | | | | | | | | | | This patch fixes two issues: - The RWHV delegate of the old page would not be detached from the view when attaching a new page to that view. Call reattachRWHV as we do on the new page to make sure that the delegate gets unparented from the view. - QtWebKit documents that a page having the view as its QObject parent should be deleted when setPage is called with a new page. This would cause QupZilla to leak the page when opening a new window through a link. This also adds a workaround to avoid a crash when unparenting the delegate where QOpenGLWidget would try to call paintGL without a valid QSurface. Change-Id: Icd2659f441d2220c26dc175d66424e6c26125861 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Widgets: Fix a crash on shutdownJocelyn Turcotte2014-04-091-1/+1
| | | | | | | | | The root node doesn't clean itself up immediately inside the SG renderer when destroyed. Just avoid the issue by destroying the renderer first. Change-Id: I833b7fdc411f149631fd13d1c1fca515b9402bf4 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Get rid of the BackingStore rendering pathJocelyn Turcotte2014-04-081-6/+1
| | | | | | | | | Now that the widgets view is also using the delegated renderer, there are no supported configuration that use the BackingStore rendering path, itself on the way of deprecation in Chromium. Change-Id: I4ab889f6a7c65e8447c259faf2c7a98b88c1acf5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Render the widgets view using the scene graph into a QOpenGLWidgetJocelyn Turcotte2014-04-081-28/+49
| | | | | | | | | | | | | | | This means that widgets application now need to setup the GL context sharing as well. QWebEngineWidgets::initialize() must be called, which has the same effect as QWebEngine::initialize(). The QtWebEngineWidgets now depends on the QtWebEngine module to make this happen. Since QOpenGLWidget is only available in Qt 5.3, this patch also disables the webenginewidgets module completely when building using Qt 5.2. Change-Id: I0e99a779d1eb080f2ccf5a338ff0763ad64e6eba Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Revert part of the RenderWidgetHostViewQtDelegate refactoringJocelyn Turcotte2014-04-081-0/+194
| | | | | | | | | | | This reverts parts of commit 9c198939be1ef064d1a2430a4b9991f2fe16f359. This does keeps the popup fixes and removes support for QWebEnginePage::setViewportSize and QWebEnginePage::render until we can evaluate the needs vs the cost of such feature. Change-Id: I1b55b751d463717b1462393ea8cd353422f8fdbb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* [Widgets] RenderWidgetHostViewQtDelegate refactoringPierre Rossi2014-02-121-173/+0
| | | | | | | | | | | | | | | Break up the delegate implementation into two distinct subclasses. The first one offers a way for the WebPage to tap into the RenderWidgetHostView directly, while a different implementation that is backed by a top-level widget can be used to show WebUI popups on screen. This has the benefit of not having a child widget in the webview among other things. It also fixes our popups and allows them to fall outside the window frame. Change-Id: I80dc1e4f21bb91ff47c75a626d330f88eacce8c6 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Quick: Support reparentingArvid Nilsson2014-01-311-6/+5
| | | | | | | | | | | | | | | | | To support reparenting, we make the compositing surface independent of the window by using gfx::TEXTURE_TRANSPORT. We also need to be able to keep frame data across window changes so we can reconstruct the QSGNode tree in a new context, so extract that data into DelegatedFrameNodeData class. Any context-specific data is still stored in DelegatedFrameNode. Also hook up window changes to WebContents::WasShown/Hidden for Quick. Remove checking of Qt isVisible state, this mechanism is used to sync Chromium with Qt, not the other way around. WasShown/Hidden is orthogonal to Show/Hide, and can use different triggers. However for Widgets it probably makes sense to hook both up to widget visibility. Change-Id: I1ef4b50cd61b8e54b791e03f0b41929c42fec8bf Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Fix QWebEngineView to page reattachment.Jocelyn Turcotte2014-01-171-3/+7
| | | | | | | | This fixes the crash in tst_QWebEngineView::reusePage. Also add a test to check the case where show() would react incorrectly. Change-Id: I40247c7c225d74b26675b6a7fa5ff1f06d3bb3e6 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Moving sources to src part 1: Move files.Jocelyn Turcotte2013-11-281-0/+170
This only move files without adjusting any paths. This moves: - lib/quick -> src/webengine/api (API files) lib/quick -> src/webengine (other files) This contains the main QtWebEngine module library since <ec7b2ee70a8b2db7fb87f50671a001ddd54697b0>. - lib/widgets -> src/webenginewidgets Also rename this directory to match its module name and rename Api to api. - lib -> src/core - process -> src/process - resources -> src/core/resources - tools/* -> tools/scripts/ The build directory is spread as follow: - build/build.pro -> src/core/gyp_run.pro - build/qmake_extras/* -> src/core/ (for the host and target .pro files) - build/qmake -> tools/qmake - Build related scripts -> tools/buildscripts Change-Id: I0cded1de772c99c0c1da6536c9afea353236b4a1 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>