New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial support for 'com.canonical.Unity.LauncherEntry' APIs #590
Conversation
appIcons.js
Outdated
if (count <= 9999) { | ||
return count.toString(); | ||
} else if (count < 10**5) { | ||
let thousands = count / 10**3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick observation: the 10**x syntax is not supported on gjs version of my system (Debian Stretch, Gnome 3.22). For retrocompatibily -- so far I have been supporting 3.18--3.24 with the same codebase -- better stick to 1ex format form the moment.
launcherAPI.js
Outdated
} | ||
}, | ||
|
||
setDBusName(dbusName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing 'function'. Again, it might work in the latest js but it doesn't on my system.
Hi Andrea, thanks for the PR. I tried to run your code and and found a couple for minor incompatibilities (I left a couple fo comments here). I wasn't able to test the badges with your script because I don't have libunity on my system at the moment... I will try to have a closer look in the next few days. |
Fixed thanks. |
Any news? |
I added support for progress bar too. The design is based on the one of Plank. |
@micheleg & @franglais125: sorry to bother you with this, but do you have a moment for a review on Andrea's work? This is the last dock modification we would like to have for 17.10, and as you know, the timeline is short (sorry to come late with this) ;) Now that both indicator numbers and progress bar are included, it would be great to have your opinion on this. If you don't have time, we can cherry-pick on our dock branch for now, still ensuring it goes upstream afterwards, as you prefer :) |
appIcons.js
Outdated
let [surfaceWidth, surfaceHeight] = area.get_surface_size(); | ||
let cr = area.get_context(); | ||
|
||
iconSize = this.icon.iconSize * scaleFactor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing let
.
@@ -1636,6 +1668,7 @@ var DockManager = new Lang.Class({ | |||
Name: 'DashToDock.DockManager', | |||
|
|||
_init: function() { | |||
this._remoteModel = new LauncherAPI.LauncherEntryRemoteModel(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know that it is strictly necessary, but this object is never destroyed.
In Line ~1921 we can add this._remoteModel.destroy();
, since the .destroy()
method is already available.
@azzar1 I got this running on 17.10. Nice work! Generally speaking, this is something that will only work in Ubuntu? Unfortunately I run Debian, and I haven't found the libraries readily available. @didrocks I will give it some testing (on 17.10) and see if I find problems/improvements. However, it's really up to @micheleg to plan the inclusion/path forward. Cheers! |
launcherAPI.js
Outdated
Gio.DBus.session.signal_unsubscribe(this._launcher_entry_dbus_signal_id); | ||
} | ||
|
||
if (this_._dbus_name_owner_changed_signal_id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo this_
Fixed. |
Sorry, I missed this conversation. Unfortunately I didn't find the time to
look into this, beside my initial overview. What is your schedule?
I should be able to give this a thorough look by the end of the weekend,
but I can't promise I'll be able to review this in time. Thus you might
want to cherry-pick all these commits in your branch. In any case I
confirm I'm intentioned to merge this feature in master as soon as
possible, to avoid diverging between the two branches.
My only concern was about introducing dependencies on Ubuntu specific
libraries, but from the overview of the code it didn't seem to be the case.
Can you confirm this?
On 21 Sep 2017 00:26, "Andrea Azzarone" <notifications@github.com> wrote:
Fixed.
Regarding the question "Generally speaking, this is something that will
only work in Ubuntu?": Unfortunetly there is not a standard for this type
of things, but most docks (like plank, etc.) supports the unity-api. It
must be considered that using libunity is not compulsory as libunity is
just a "wrapper" to easliy implement the required dbus interfaces.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#590 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABo0PsHcsXDWAnAzj0kgzgS_KfzSCgclks5skZ8NgaJpZM4PNRYm>
.
|
It does not use ubuntu specific libraries. Everything is based on dbus. |
Ok, that was indeed my understanding.
On 21 Sep 2017 12:25, "Andrea Azzarone" <notifications@github.com> wrote:
It does not use ubuntu specific libraries. Everything is based on dbus.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#590 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABo0PhzEN2o_MeORWLGquY9zhQ6B8jOxks5skkelgaJpZM4PNRYm>
.
On 21 Sep 2017 12:25, "Andrea Azzarone" <notifications@github.com> wrote:
It does not use ubuntu specific libraries. Everything is based on dbus.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#590 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABo0PhzEN2o_MeORWLGquY9zhQ6B8jOxks5skkelgaJpZM4PNRYm>
.
On 21 Sep 2017 12:25, "Andrea Azzarone" <notifications@github.com> wrote:
It does not use ubuntu specific libraries. Everything is based on dbus.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#590 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABo0PhzEN2o_MeORWLGquY9zhQ6B8jOxks5skkelgaJpZM4PNRYm>
.
|
@azzar1 Is there a way of easily running the dbus wrapper without installing libunity? I'm not familiar with the code, browsing through the source I found the I'm asking to know how difficult it would be to have this available on other systems. |
@franglais125 you need to implement inside the application a dbus server exporting the required interface with the wanted properties. libunity just does this. I don't have any code example but it's not complicated at all. |
I had a look at this. Overall I'm ok with it. I really need to rething the code organization ... but this is good enough for now. I've consolidated the history and made few cosmetic changes in the development branch. However, I could not check if this is working properly: I tried to use your script in a Ubuntu Artful virtual machine, but I could't see any notification badge, nor see any error. Any suggestion? There's a couple of thing missing/tofix that probably do not directly affect the ubuntu side.
If you confirm that the branch is indeed working, I'm happy to merge into master. |
Here is a small thing to think about. I don't see it as a deal breaker, but still something that can be fixed: Perhaps we can toggle the notifications when showing the number overlays? Edit: something like this: franglais125@2e6e28c |
@micheleg The branch is indeed working. |
http://paste.ubuntu.com/25615125/ This a simple python script that can be used to test the code. This code does not uset libunity. |
}, | ||
|
||
insertEntryRemote: function(remote) { | ||
if (!remote || this._remoteEntries.includes(remote)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@azzar1 I used your new script (thanks!), and got this running on Gnome 3.22.
This line is throwing an error for me, since Debian is still on mozJS 24.
Perhaps we can change includes
(which is not supported until mozJS 52) with:
if (!remote || this._remoteEntries.indexOf(remote) !== -1)
}, | ||
|
||
removeEntryRemote: function(remote) { | ||
if (!remote || !this._remoteEntries.includes(remote)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. includes
-> indexOf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
I also manage to get the badges to work with your new script. I've merged the branch into master. I've only skipped the commit changing the default colour, which you might want to keep in the ubuntu-branch for the time being. |
I've seen you had already merged in the ubuntu branch and made a new release/announcement. Closing this pull request. Thanks for the contribution @azzar1 @didrocks @franglais125! |
Thanks a lot as usual @micheleg, @franglais125 to have make that easy for ubuntu! I think @azzar1 will help you once we release 17.10 to get the final options and touches done! ;) |
@micheleg Does the ubuntu feature (progress, badges) works on other distributions as well ? like antergos , fedora ? |
If the application uses the unity launcher API yes. E.g. I didn't checked
but electron apps should work.
…On 12 Oct 2017 18:05, "gayanper" ***@***.***> wrote:
@micheleg <https://github.com/micheleg> Does the ubuntu feature
(progress, badges) works on other distributions as well ? like antergos ,
fedora ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#590 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADgbsc5sNUUS19w1kBfc4SXq2Ybykvm1ks5srjjEgaJpZM4PNRYm>
.
|
man this looks so cool hope some day unity api will be in the aur for use on manjaro and arch |
The only thing missing from here is the |
Initial support to 'com.canonical.Unity.LauncherEntry' APIs. At the moment it only supports the badge notification. The code can be tested using the following script: http://paste.ubuntu.com/25473314/