We have moved to a new Sailfish OS Forum. Please start new discussions there.
68

Patch for bringing back the MeeGo-style close gesture (swipe from top)

Tracked by Jolla

asked 2019-01-05 14:18:37 +0300

figgis-diggis gravatar image

updated 2019-11-07 12:34:08 +0300

cg gravatar image

As the title suggests, after a little digging around I figured out a way to bring back the MeeGo-style closing gesture — swipe from any place of the top edge when there is an application on the foreground closes said application — to the Sailfish 3.

The Top Menu is still there unchanged and can be accessed by any other way (top to bottom swipe on the home screen, notifications area or lockscreen or just a tap on the status bar).

Since I'm too lazy to create openrepos package, I will just post the instructions here. All you need to do is edit /usr/share/lipstick-jolla-home-qt5/compositor.qml

The first line we're interested in is line 896 for 3.1.0: update for 3.2 line number is 905

topAcceptMargin: Math.max(QtQuick.Screen.pixelDensity * 10, (largeScreen ? (SS.Screen.width - topMenuLayer.exposedArea.width) / 2 : Theme.itemSizeMedium))

What it does is set the areas dragging down from which triggers the closing gesture. So, as quick and dirty solution — just make it equal to the screen width.

topAcceptMargin: SS.Screen.width

And another line is 1279 for 3.1.0: update for 3.2: line 1290

|| appLayerItem.active

If you scroll a bit higher you'll see that it is a single item in the list of possible variants for opening the top menu. Since we don't need it to open when trying to close the running app, that line can be just deleted.

And that's it.

Here are the diff file and the modified compositor.qml (it uploaded as .gz but it's actually .tar.gz). If anybody wants to create a full openrepos or patchmanager patch package — they're welcome.

edit retag flag offensive close delete

Comments

6

thx for your work :) You can create a Patchamanger Patch very easy, no need to create rpms. Just rename your diff, zip it and upload it. Instructions are here: Patchmanager Web

jayki ( 2019-01-05 16:43:18 +0300 )edit
1

Was waiting for that! Thanks!

stephan ( 2019-01-05 21:50:33 +0300 )edit
10

Ah - seems like my OS will become usable again... What a relief. ;)

ossi1967 ( 2019-01-06 12:17:05 +0300 )edit
1

Corresponding lines in Xperia X (F5122) seem to be 793 and 1163.

japsi ( 2019-01-06 14:59:51 +0300 )edit

Errr... I use Xperia X image too but it was exactly the lines i mentioned in my message. Maybe something to do with text wrapping?

Just in case — if you refer to the line numbering in the attached file, please note that the attached archive is actually .tar.gz, not just a .gz. Since tar just jams files together, if you open it as is, you'll just see the diff and the compositor.qml in a single file.

figgis-diggis ( 2019-01-06 15:21:58 +0300 )edit

Thanks. Basically seek and destroy the wrong UI choice. Will try soon on Jolla Tablet, even if it's silly to have to edit the OS after that Jolla itself broke the gesture!

I published on december a Jt question about this (it's also a medium article) but there is not way to have an impact on UI choices.

minojolla ( 2019-01-06 16:09:29 +0300 )edit

Yep, extra lines in my qml-file are from Alinas "Volume control" patch which stopped working after modification.So little bit extra work for me...

japsi ( 2019-01-06 18:42:48 +0300 )edit

Nice. I'll try this soon. Thanks for the info!

Edit: Worked like a charm. Hopefully this also works after SFOS update Sipoonkorpi. This doesn't seem to be configurable in it...

Wizor ( 2019-01-06 22:35:21 +0300 )edit

definitely a missing option. thanks for the patch

NuklearFart ( 2019-01-09 10:27:14 +0300 )edit

Thank you for the relieve!

deloptes ( 2019-01-11 00:19:37 +0300 )edit

this workaround still works with SFOS 3.0.1.14 THANK YOU SO MUCH!!!

cg ( 2019-02-08 09:26:56 +0300 )edit

and still this works for SFOS 3.0.2.8 ...great!

cg ( 2019-03-29 18:53:22 +0300 )edit

@cg thanks for letting us know
that means you were able to apply the patch without changes?

rozgwi ( 2019-03-29 21:37:07 +0300 )edit

@rozgwi yes, I just edited the two lines as far as I remember the line numbers did not change or at least not much

cg ( 2019-04-07 13:36:10 +0300 )edit

@rozgwi yes, it is still the same and it works just great

deloptes ( 2019-04-08 17:17:21 +0300 )edit

Really great fix and thanks for sharing. It makes the whole user experience much better for me (and it shows how annoying the recent solution really is, at least for my taste)

TrulloF ( 2019-04-23 19:31:12 +0300 )edit
1

so with 3.0.3.8 line numbers changed to 896 an 1281

cg ( 2019-04-29 23:48:02 +0300 )edit

My .patch looks like this

--- /usr/share/lipstick-jolla-home-qt5/compositor.qml +++ /usr/share/lipstick-jolla-home-qt5/compositor.qml @@ -896,7 +896,7 @@ rightEnabled: Desktop.startupWizardRunning topEnabled: !Desktop.startupWizardRunning &&

!topMenuLayerItem.active // Minimum top accept margin is 10mm - topAcceptMargin: Math.max

(QtQuick.Screen.pixelDensity * 10, (largeScreen ? (SS.Screen.width -

topMenuLayer.exposedArea.width) / 2 : Theme.itemSizeMedium)) + topAcceptMargin: SS.Screen.width }

                     onAboutToShowWindow: {

@@ -1281,7 +1281,6 @@ && DeviceLock.state <= DeviceLock.Locked && (topMenuLayerItem.active || homeLayer.active - || appLayerItem.active || alarmLayerItem.inCall || lockScreenLayerItem.active)

AND .json like this: { "name": "close-gesture", "display_name": "Close gesture revived", "description": "Bring back the classic (MeeGo/SFOS 2) close gesture for SFOS 3.0 with the new Top-Menu available only from Events View and Homescreen.\r\nOriginal work by figgis-diggis@TJC", "category": "homescreen", "sources":"", "version": "0.0.1", "compatible": ["3.0.1.11","3.0.1.14","3.0.2.8","3.0.3.8"] }

But still, patchmanager fails to install this custom made patch? any help?

peakki ( 2019-04-30 12:21:24 +0300 )edit

did you regenerate the patch or have you just changed the line numbers?
I don't know the syntax of diff files very well but for 3.0.1 I applied the necessary changes to a copy of the QML files an recreated the patch.

rozgwi ( 2019-05-01 21:21:56 +0300 )edit

@rozgwi, I changed line numbers. I think that I have not done this all properly. Is something other needed than updated .json and .patch files located in /usr/share/patchmanager/patches/close-gesture?

peakki ( 2019-05-03 13:29:31 +0300 )edit

tl;dr: Sorry, no idea why it's not working.

In my experience a proper patch is important, with correct hunk references (the @'s you see in the code block).
BUT for me the patch still works without changes after upgrading to Hossa.
I don't really understand all factors involved, maybe there are small differences depending on the used phone (mine is Xperia X).

rozgwi ( 2019-05-04 12:58:26 +0300 )edit

yes I have also Xperia X. could you maybe send your files to me, so I can test it can I get it working

peakki ( 2019-05-05 10:52:58 +0300 )edit

@peakki:
I don't have time to validate it but if I remember correctly, the patch on my device is still unchanged from my post below.
But thankfully deloptes has already posted his version. does that work for you?

rozgwi ( 2019-05-13 14:55:39 +0300 )edit

neat ptach - but I prefer the @cornerman's no home carousel to close app and @Ancelad's top menu control for everything else, like sending the phone to sleep.

danfin ( 2019-11-07 13:28:57 +0300 )edit

5 Answers

Sort by » oldest newest most voted
10

answered 2019-01-10 02:15:06 +0300

rozgwi gravatar image

updated 2019-02-09 12:26:17 +0300

Thanks a bunch figgis-diggis!
With a little help from @Edz (yes I saw that comment ;p ) and @coderus I was able to convert this into a patch for PM3. It's been tested on Sailfish X 3.0.1.11 (Xperia X)
Since I don't know when I'll be able to put it up to the web catalog here it is:

patch.json

{
    "name": "close-gesture",
    "display_name": "Close gesture 'revived'",
    "description": "Bring back the classic (MeeGo/SFOS 2) close gesture for SFOS 3.0 with the new Top-Menu available only from Events View and Homescreen.\r\nOriginal work by figgis-diggis@TJC",
    "category": "homescreen",
    "sources":"",
    "version": "0.0.1",
    "compatible": ["3.0.1.11","3.0.1.14"]
}

unified_diff.patch

--- /usr/share/lipstick-jolla-home-qt5/compositor.qml
+++ /usr/share/lipstick-jolla-home-qt5/compositor.qml
@@ -882,7 +882,7 @@
                             rightEnabled: Desktop.startupWizardRunning
                             topEnabled: !Desktop.startupWizardRunning && !topMenuLayerItem.active
                             // Minimum top accept margin is 10mm
-                            topAcceptMargin: Math.max(QtQuick.Screen.pixelDensity * 10, (largeScreen ? (SS.Screen.width - topMenuLayer.exposedArea.width) / 2 : Theme.itemSizeMedium))
+                            topAcceptMargin: SS.Screen.width
                         }

                         onAboutToShowWindow: {
@@ -1254,7 +1254,6 @@
                              && DeviceLock.state <= DeviceLock.Locked
                              && (topMenuLayerItem.active
                                  || homeLayer.active
-                                 || appLayerItem.active
                                  || alarmLayerItem.inCall
                                  || lockScreenLayerItem.active)
edit flag offensive delete publish link more

Comments

Possible conflicts on my Xperia X: Volume control settings patch.

eson ( 2019-01-10 10:23:47 +0300 )edit

I have that patch too. Works though, even with Top menu content enabled in addition

rozgwi ( 2019-01-10 12:52:24 +0300 )edit

Yep, works for me to. It was just a notation for possible conflicts.

eson ( 2019-01-10 20:06:32 +0300 )edit

Very nice! Thank you too.

figgis-diggis ( 2019-01-11 06:18:52 +0300 )edit

Thanks for posting this. Apologies if I have overlooked something simple, but I cannot figure out how to apply those files to PM3. Is there a way to apply local patch files to PM3 that I have missed?

Drekkie ( 2019-01-16 19:34:50 +0300 )edit
3

answered 2019-05-08 00:17:16 +0300

deloptes gravatar image

3.0.3.9 the patch looks like

--- /usr/share/lipstick-jolla-home-qt5/compositor.qml.bkp
+++ /usr/share/lipstick-jolla-home-qt5/compositor.qml
@@ -893,7 +893,7 @@
                             rightEnabled: Desktop.startupWizardRunning
                             topEnabled: !Desktop.startupWizardRunning && !topMenuLayerItem.active
                             // Minimum top accept margin is 10mm
-                            topAcceptMargin: Math.max(QtQuick.Screen.pixelDensity * 10, (largeScreen ? (SS.Screen.width - topMenuLayer.exposedArea.width) / 2 : Theme.itemSizeMedium))
+                            topAcceptMargin: SS.Screen.width
                         }

                         onAboutToShowWindow: {
@@ -1277,7 +1277,6 @@
                              && DeviceLock.state <= DeviceLock.Locked
                              && (topMenuLayerItem.active
                                  || homeLayer.active
-                                 || appLayerItem.active
                                  || alarmLayerItem.inCall
                                  || lockScreenLayerItem.active)

and works just as expected

edit flag offensive delete publish link more

Comments

how to get this working on 3.1 ? XA2 dual sim

peakki ( 2019-07-30 14:39:55 +0300 )edit

Exactly the same way, the relevant lines are 896 and 1279 (I've just updated the OP).

figgis-diggis ( 2019-08-16 23:46:21 +0300 )edit
1

answered 2019-11-07 15:21:58 +0300

miau gravatar image

Unified_diff.patch for 3.2:

--- /usr/share/lipstick-jolla-home-qt5/compositor.qml   2019-10-02 02:00:00.000000000 +0200
+++ /usr/share/lipstick-jolla-home-qt5/compositor.qml   2019-11-07 13:52:16.465103138 +0100
@@ -896,7 +896,7 @@
                         rightEnabled: Desktop.startupWizardRunning
                         topEnabled: !Desktop.startupWizardRunning && !topMenuLayerItem.active
                         // Minimum top accept margin is 10mm
 -                            topAcceptMargin: Math.max(QtQuick.Screen.pixelDensity * 10, (largeScreen ? (SS.Screen.width - 
                              topMenuLayer.exposedArea.width) / 2 : Theme.itemSizeMedium))
+                           topAcceptMargin: SS.Screen.width
                     }

                     onAboutToShowWindow: {
@@ -1279,7 +1279,6 @@
                          && DeviceLock.state <= DeviceLock.Locked
                          && (topMenuLayerItem.active
                              || homeLayer.active
-                             || appLayerItem.active
                              || alarmLayerItem.inCall
                              || lockScreenLayerItem.active)
edit flag offensive delete publish link more

Comments

awesome, thank you!

rozgwi ( 2019-11-07 16:50:55 +0300 )edit
1

answered 2019-12-17 22:15:31 +0300

rozgwi gravatar image

updated 2019-12-22 23:40:18 +0300

Updated version for 3.2.1

EA version! - right now PM won't apply this for me, saying it can't find the file to patch. I checked the diff and can't find any issues, maybe it'll work for you.... fixed, works now.

--- /usr/share/lipstick-jolla-home-qt5/compositor.qml
+++ /usr/share/lipstick-jolla-home-qt5/compositor.qml
@@ -912,9 +912,7 @@
                             rightEnabled: Desktop.startupWizardRunning
                             topEnabled: !Desktop.startupWizardRunning && !topMenuLayerItem.active
                             // Minimum top accept margin is 10mm
-                            topAcceptMargin: Math.max(QtQuick.Screen.pixelDensity * 10,
-                                                      (largeScreen ? (SS.Screen.width - topMenuLayer.exposedArea.width) / 2
-                                                                   : Theme.itemSizeMedium))
+                           topAcceptMargin: SS.Screen.width
                         }

                         onAboutToShowWindow: {
@@ -1299,7 +1297,6 @@
                              && DeviceLock.state <= DeviceLock.Locked
                              && (topMenuLayerItem.active
                                  || homeLayer.active
-                                 || appLayerItem.active
                                  || alarmLayerItem.inCall
                                  || lockScreenLayerItem.active)

and as a 'bonus' an updated patch JSON as well:

{   "name": "classic-close-gesture",
    "display_name": "Classic close gesture",
    "description": "Bring back the classic (MeeGo) close gesture for SFOS 3\r\nwith the new Top-Menu available only from Events View and Home Screen.\r\nOriginal work by figgis-diggis @ TJC",
    "category": "homescreen",
    "version": "3.2.1",
    "compatible": ["3.2.1.19", "3.2.1.20"],
    "infos": {
        "maintainer": "Sailor community",
    }
    "discussion": "https://together.jolla.com/question/196795/"}
    }
edit flag offensive delete publish link more
-6

answered 2019-04-24 15:26:52 +0300

Vincent gravatar image

Maybe i misunderstand what is being solved here, but i recently found a gesture that seems to do out of the box what you want (on 3.0.2.8 on a Gemini). When i edge-swipe down in the top-left corner of an open app, it closes the app.

edit flag offensive delete publish link more

Comments

Yes, you misunderstood. Maybe you can delete your answer.

Pohli ( 2019-04-24 18:50:09 +0300 )edit

I could, but not on the authority of somone just telling me to. Can you please explain the difference between this solution and what i said?

Vincent ( 2019-04-25 03:33:19 +0300 )edit
2

@Vincent You described current behavior of swipe from top after SFOS 3. Top-left and top-right is closing app while top-middle is opening top menu.
The update is returning to functionality before SFOS 3, swipe from top is closing app on whole area (not only top-left or top-right).

sepuka ( 2019-04-25 17:14:25 +0300 )edit

and someone even upvoted this answer - unbelievable! Please, next time clarify before answering - also a comment can be easily converted to an answer if needed

deloptes ( 2019-04-26 11:28:51 +0300 )edit

Alright, so we have the same functionality with the same gesture out of the box. The difference is that in this patch it also works at the top-middle. I think people should be aware of the functionality out of the box, in order to make an educated choice. I for one, do not like to install additional software i do not need, only because i was not aware that the functionality already existed in almost the same form.

Vincent ( 2019-04-26 15:39:13 +0300 )edit
Login/Signup to Answer

Question tools

Follow
24 followers

Stats

Asked: 2019-01-05 14:18:37 +0300

Seen: 3,499 times

Last updated: Dec 22 '19