Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hkmwsesuv
- sailfish-browser-1.17.7-1.12.5.jolla.armv7hl.rpm
- https://github.com/sailfishos/sailfish-browser/commit/66e744da14fc4268bfd232678386496016aa3a57#diff-ba3c890c29799181dff248914805b990
- declarativewebcontainer.cpp
- void DeclarativeWebContainer::updateContentOrientation(Qt::ScreenOrientation orientation)
- {
- if (gForceLandscapeToPortrait) {
- if (orientation == Qt::PortraitOrientation) {
- orientation = Qt::InvertedLandscapeOrientation;
- }
- else if (orientation == Qt::InvertedPortraitOrientation) {
- orientation = Qt::LandscapeOrientation;
- }
- else if (orientation == Qt::LandscapeOrientation) {
- orientation = Qt::PortraitOrientation;
- }
- else if (orientation == Qt::InvertedLandscapeOrientation) {
- orientation = Qt::InvertedPortraitOrientation;
- }
- }
- if (m_mozWindow) {
- bool orientationShouldChange = (orientation != m_mozWindow->pendingOrientation());
- m_mozWindow->setContentOrientation(orientation);
- if (orientationShouldChange) {
- emit pendingWebContentOrientationChanged();
- }
- }
- if (gForceLandscapeToPortrait) {
- if (orientation == Qt::InvertedLandscapeOrientation) {
- orientation = Qt::PortraitOrientation;
- }
- else if (orientation == Qt::LandscapeOrientation) {
- orientation = Qt::InvertedPortraitOrientation;
- }
- else if (orientation == Qt::PortraitOrientation) {
- orientation = Qt::LandscapeOrientation;
- }
- else if (orientation == Qt::InvertedPortraitOrientation) {
- orientation = Qt::InvertedLandscapeOrientation;
- }
- }
- reportContentOrientationChange(orientation);
- }
- browserpage.qml
- function inputMaskForOrientation(orientation) {
- // mask is in portrait window coordinates
- var mask = Qt.rect(0, 0, Screen.width, Screen.height)
- if (!window.opaqueBackground && webView.enabled && browserPage.active && !webView.touchBlocked && !downloadPopup.visible) {
- var overlayVisibleHeight = browserPage.height - overlay.y
- switch (orientation) {
- case Orientation.None:
- case Orientation.Landscape:
- mask.y = overlay.y
- // fallthrough
- case Orientation.LandscapeInverted:
- mask.height = overlayVisibleHeight
- break
- case Orientation.PortraitInverted:
- mask.x = overlay.y
- // fallthrough
- case Orientation.Portrait:
- mask.width = overlayVisibleHeight
- }
- }
- return mask
- }
- sailfish-browser.spec
- Version: 1.17.7
- Release: 1.12.5.jolla
- 70-browser.conf
- BROWSER_FORCE_LANDSCAPE_TO_PORTRAIT="1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement