Merge lp://staging/~jeremy-munsch/synapse-project/fix-notification into lp://staging/synapse-project

Proposed by Jeremy Munsch
Status: Work in progress
Proposed branch: lp://staging/~jeremy-munsch/synapse-project/fix-notification
Merge into: lp://staging/synapse-project
Diff against target: 113 lines (+17/-35)
5 files modified
configure.ac (+1/-3)
debian/control (+0/-1)
src/plugins/imgur-plugin.vala (+8/-15)
src/plugins/pastebin-plugin.vala (+8/-15)
src/ui/synapse-main.vala (+0/-1)
To merge this branch: bzr merge lp://staging/~jeremy-munsch/synapse-project/fix-notification
Reviewer Review Type Date Requested Status
Rico Tzschichholz Needs Fixing
Review via email: mp+273323@code.staging.launchpad.net

Description of the change

Remove usage of libnotify as it was breaking imgur and pastbin plugins and making desktop hangs before failling.

Not making use of http://valadoc.org/#!api=gio-2.0/GLib.Notification which works great.

To post a comment you must log in.
Revision history for this message
Rico Tzschichholz (ricotz) wrote :

Looks reasonable, but do not be lazy! "n" is not a good variable name at all. So "notification" it is.

More of a problem is the implicit bump to glib >= 2.40 which could use some thinking.

review: Needs Fixing
Revision history for this message
Rico Tzschichholz (ricotz) wrote :

Please use descriptive commit messages mainly in the present tense.

"topic/source-target": "short description of the actual change"
\n
"long description if needed"

e.g. "Replace usage of libnotify with GLib.Notification"

And use "bzr --fixes lp:XXXXXX" if a bug is available to reference the bug and don't explicitly mention the bug number in the commit message.

This concerns all your merge-proposals

Revision history for this message
Jeremy Munsch (jeremy-munsch) wrote :

Ok, thank you for the review, i'll look for these.

Revision history for this message
Jeremy Munsch (jeremy-munsch) wrote :

Also i just saw https://launchpad.net/ubuntu/+source/glib2.0,
and precise is still at supported until late 2018 https://wiki.ubuntu.com/LTS.

I guess that this merge is dead for now sadly, because GLib is still at 2.32, there might be no workaround this is guess ?

Revision history for this message
Jeremy Munsch (jeremy-munsch) wrote :

Ok I have now updated my other merge proposals as well as this one with your commit recommendations. :P

615. By Rico Tzschichholz

main: Properly setup internationalization

616. By Jeremy Munsch

core: Handle UriMatches pointing to executable files

617. By Rico Tzschichholz

build: Drop optional dependency on gnome-common

618. By Rico Tzschichholz

build: Bump requirements glib-2.0 >= 2.40, valac >= 0.24.0

619. By Jeremy Munsch

Add support for "Additional applications actions"

Source and evaluate "Desktop Action" groups in desktop-files.

Revision history for this message
Rico Tzschichholz (ricotz) wrote :

Please rebase and test it again. Seems not to work here.

review: Needs Information
Revision history for this message
Jeremy Munsch (jeremy-munsch) wrote :

I just put modifications on last branch version and it is working here.

Revision history for this message
Jeremy Munsch (jeremy-munsch) wrote :

To test it i:
- had a selection and search for text -> send pastebin - OK
- search an image -> send to imgur - OK

No hang, no crash.

620. By Jeremy Munsch

chromium: Set mime-type of BookmarkMatch

Revision history for this message
Rico Tzschichholz (ricotz) wrote :

OK, it is *not* working here (gnome-shell 3.18.2 and glib 2.27.1) while the existing solution (libnotify) seems to work flawlessly.

review: Needs Information
Revision history for this message
Jeremy Munsch (jeremy-munsch) wrote :

I'll make some tests on a virtual machine asap

Revision history for this message
Jeremy Munsch (jeremy-munsch) wrote :

Just had a few tests on
Ubuntu 15.10 fresh install (libglib 2.46.1-1) - *OK*
Lubuntu 15.10 fresh install (libglib 2.46.1-1) - *OK*
Kubuntu 15.10 (libglib 2.46.1-1) - *OK*

-- Alright, i was about to test debian + gnome DE, but i checked in devhelp as you adviced me once,
i found that there is an implicit bump to glib 2.40, which is actually what you said on #1 lol

So i think it should need a preprocessor instruction on compile to check which method to use.
I'll try to figure out this and update PR.

Revision history for this message
Rico Tzschichholz (ricotz) wrote :

> Just had a few tests on
> Ubuntu 15.10 fresh install (libglib 2.46.1-1) - *OK*
> Lubuntu 15.10 fresh install (libglib 2.46.1-1) - *OK*
> Kubuntu 15.10 (libglib 2.46.1-1) - *OK*

Hmm, I see. I wonder why it isn't working with my setup.

> -- Alright, i was about to test debian + gnome DE, but i checked in devhelp as
> you adviced me once,
> i found that there is an implicit bump to glib 2.40, which is actually what
> you said on #1 lol
>
> So i think it should need a preprocessor instruction on compile to check which
> method to use.
> I'll try to figure out this and update PR.

You are not making much sense or did you really miss
https://bazaar.launchpad.net/~synapse-core/synapse-project/trunk/revision/618

(It is not a dependency or build problem)

Revision history for this message
Jeremy Munsch (jeremy-munsch) wrote :

> OK, it is *not* working here (gnome-shell 3.18.2 and glib 2.27.1) while the existing solution > (libnotify) seems to work flawlessly.

> You are not making much sense or did you really miss
> https://bazaar.launchpad.net/~synapse-core/synapse-project/trunk/revision/618
>
> (It is not a dependency or build problem)

Yes it got out of my mind as i saw you had glib < 2.40.

I'm instal fresh debian + Gnome DE right now to make a test

Revision history for this message
Rico Tzschichholz (ricotz) wrote :

Ah, I am sorry, that was a typo which meant to be "glib 2.47.1"

Revision history for this message
Jeremy Munsch (jeremy-munsch) wrote :

Just made other tests :
Fedora 23, glib 2.46.1, gnome-shell 3.18.1, valac 0.30 - *Not Working*
Debian Jessy, glib 2.42.1-1, gnome-shell 3.14.4.1.deb8u1, valac {0.26,0.30} - *Not Working*

621. By Rico Tzschichholz

ui: Use get_allocation() instead of multiple calls to get_allocated_*()

622. By Rico Tzschichholz

ui: Use some unowned variables

623. By Rico Tzschichholz

ui: Fix usage of get_state_flags()

624. By Rico Tzschichholz

ui: Use some unowned variables

625. By Rico Tzschichholz

ui: Clean up struct initializations

626. By Rico Tzschichholz

widgets: Cache struct in loop

627. By Rico Tzschichholz

view-base: Verify presence of GdkX11Screen before using it

628. By Rico Tzschichholz

tile: Fix regression of r623

Revision history for this message
Jeremy Munsch (jeremy-munsch) wrote :

I think this is obviously a bug,
I ran this sample code:
http://paste.ubuntu.com/13283891/
with valac --pkg=gio-2.0 notif.vala

Tested on all previous VM i mentionned, and it is not workin on fedora and debian.

I'm thinking of filling a bug, still to found from which lib occurs the bug, my guess is it is likely to be gio having a problem with gnome-shell, even this sounds weird; i'm thinking of filling a bug in https://bugzilla.gnome.org.

Is using a fallback method would be acceptable ? It may be checking env var XDG_CURRENT_DESKTOP which is filled by gnome DE with GNOME.

I'll start working on this.

Revision history for this message
Jeremy Munsch (jeremy-munsch) wrote :

Just tested this solution and it makes every distro happier :)
So both use libnotify and GLib.Notify based on XDG_CURRENT_DESKTOP == "GNOME"

Revision history for this message
Rico Tzschichholz (ricotz) wrote :

Please reinstantiate your original proposal. I won't accept this conditional stuff anyway.

Maybe look at gnome-clocks which is written in vala and is using GNotification too.

(gnome-clocks' notifications are working here)

review: Needs Fixing
Revision history for this message
Jeremy Munsch (jeremy-munsch) wrote :

Well i checked a few times to really be sure https://mail.gnome.org/archives/commits-list/2013-October/msg08602.html
It seems that GLib.notification is used exactly the same way.
Even the sample code i linked above is not working.

How ever it saw in
https://bugzilla.gnome.org/show_bug.cgi?id=710913
https://wiki.gnome.org/HowDoI/GNotification

> Warning: gnome-shell uses desktop files to find extra information (app icon, name) about the
> sender of the notification. If you don't have a desktop file whose base name matches the
> application id, then your notification will not show up.

> This will be the preferred way of launching applications, so install a
> DBus .service file, rename the .desktop file to use reverse DNS notation
> and mark it as DBus activatable.
> Using reverse DNS notation for the .desktop file is also a prerequisite
> for using GLib's new notification API.

I don't know what are the "reverse DNS notation" and "DBus .service file". I'll try to find more info

Revision history for this message
Rico Tzschichholz (ricotz) wrote :

As a side-note: "var gicon = new GLib.ThemedIcon ("synapse");"

629. By Jeremy Munsch

plugins imgur/ pastebin: Replace usage of libnotify with GLib.Notification

Remove dependency of libnotify therefore implicit bump to GLib >= 2.40

Revision history for this message
Jeremy Munsch (jeremy-munsch) wrote :

Just corrected according your side note.

Revision history for this message
Jeremy Munsch (jeremy-munsch) wrote :

So what i understand, is that to use GLib.Notification with gnome-shell, Synapse has to be DBus launchable at least, yes, I have no idea how to implement that a this time.
What I know is that instead of having a classic fork checking for an existing previous instance, would have to be replaced by a DBus listener, with at least one action.

According to what I read, I could be a small change though, not sure.

Unmerged revisions

629. By Jeremy Munsch

plugins imgur/ pastebin: Replace usage of libnotify with GLib.Notification

Remove dependency of libnotify therefore implicit bump to GLib >= 2.40

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.