After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 704215 - Make System Monitor work in Wayland
Make System Monitor work in Wayland
Status: RESOLVED FIXED
Product: system-monitor
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: System-monitor maintainers
System-monitor maintainers
Depends on:
Blocks: wayland
 
 
Reported: 2013-07-14 20:49 UTC by Stefano Facchini
Modified: 2013-07-16 20:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Do not use libwcnk for obtaining icons (4.84 KB, patch)
2013-07-14 20:50 UTC, Stefano Facchini
none Details | Review
Make libwnck opt-in (8.08 KB, patch)
2013-07-14 20:51 UTC, Stefano Facchini
none Details | Review
Remove useless include (587 bytes, patch)
2013-07-14 20:51 UTC, Stefano Facchini
committed Details | Review
Make libwnck opt-in (11.25 KB, patch)
2013-07-15 11:31 UTC, Stefano Facchini
needs-work Details | Review
Make libwnck opt-in (11.35 KB, patch)
2013-07-15 21:39 UTC, Stefano Facchini
none Details | Review
Make libwnck opt-in (11.16 KB, patch)
2013-07-16 12:04 UTC, Stefano Facchini
committed Details | Review

Description Stefano Facchini 2013-07-14 20:49:41 UTC
Currently System Monitor links against libwnck, which in turn as X as a dependency. GSM uses libwnck for
1. Obtain the application icon in some corner cases.
2. Obtain the X memory usage of the application.

I admit I have not investigated thoroughly, but I think that 1. is kind of obsolete function in the .desktop file era, so I propose to just remove that code. As for 2., it seems useful when running under X, so it could be made configurable at build time. Patched attached that implement this.
Comment 1 Stefano Facchini 2013-07-14 20:50:44 UTC
Created attachment 249140 [details] [review]
Do not use libwcnk for obtaining icons
Comment 2 Stefano Facchini 2013-07-14 20:51:01 UTC
Created attachment 249141 [details] [review]
Make libwnck opt-in

Use libwnck only if the configure flag '--enable-wnck' is specified.
Comment 3 Stefano Facchini 2013-07-14 20:51:15 UTC
Created attachment 249142 [details] [review]
Remove useless include
Comment 4 Robert Roth 2013-07-14 21:32:52 UTC
Why can't we wrap the wnck icon stuff with a conditional if, just like we do for the proctable wnck-dependant part? Even if it's only for some corner cases, it might be useful in some cases. So the second and third patch are OK, I'm not sure about the first one, I'd rather have that code also tied to --enable-wnck b (in lack of deeper investigation - I am also not aware where it would be the only option to get the icon)
Comment 5 Robert Roth 2013-07-14 22:24:09 UTC
Review of attachment 249142 [details] [review]:

Thanks for the cleanup.
Comment 6 Stefano Facchini 2013-07-15 11:31:18 UTC
Created attachment 249179 [details] [review]
Make libwnck opt-in

Use libwnck only if the configure flag '--enable-wnck' is specified.
Comment 7 Stefano Facchini 2013-07-15 11:31:58 UTC
New patch with icon code ifdef'd
Comment 8 Robert Roth 2013-07-15 20:52:47 UTC
Review of attachment 249179 [details] [review]:

Thanks for the quick fix. Looks better, basically would be OK, but it unfortunately breaks the default columnset with wnck off, as the column numbers after the Xserver memory column get shifted. I'm working on fixing this and will commit afterwards, but if you have any quick suggestion on how this can be elegantly solved, I'm open for suggestions.
Comment 9 Robert Roth 2013-07-15 20:56:08 UTC
Review of attachment 249142 [details] [review]:

Thanks for the cleanup.
Comment 10 Stefano Facchini 2013-07-15 21:39:38 UTC
Created attachment 249249 [details] [review]
Make libwnck opt-in

Use libwnck only if the configure flag '--enable-wnck' is specified.

---

Ah, I didn't notice that at first... I think then that the best option is
to just avoid showing the Xserver memory column, instead of removing it
from the model (doing that in this new patch). This should preserve all the
columnset data.
Comment 11 Stefano Facchini 2013-07-15 21:50:27 UTC
(In reply to comment #10)
> Created an attachment (id=249249) [details] [review]
> Make libwnck opt-in
> 
> Use libwnck only if the configure flag '--enable-wnck' is specified.
> 
> ---
> 
> Ah, I didn't notice that at first... I think then that the best option is
> to just avoid showing the Xserver memory column, instead of removing it
> from the model (doing that in this new patch). This should preserve all the
> columnset data.

Sorry, too rushed... this patch is wrong... Have you already done work in fixing the issue? Otherwise I'll try to get it correct
Comment 12 Robert Roth 2013-07-16 08:19:40 UTC
Yes, I have tried "ignoring" the column with ifndef but I have got into some segfaults, which I couldn't sort out yet, and I will not be able today either, so the patch is welcome, after reviewing it I'll commit it, I'm sure we can sort that out until 3.9.5 release. Thanks for your help anyway, it's welcome.
Comment 13 Stefano Facchini 2013-07-16 12:04:24 UTC
Created attachment 249266 [details] [review]
Make libwnck opt-in

Use libwnck only if the configure flag '--enable-wnck' is specified.


This should be the correct one, I hope :)
The problem was some weird check in procman_get_tree_state which used
the column number instead of the column id, messing up the ordering.
Comment 14 Robert Roth 2013-07-16 20:07:34 UTC
Review of attachment 249266 [details] [review]:

Thanks, this looks fine, tested the migration and made some basic tests, as everything went fine, I've committed it.
Comment 15 Robert Roth 2013-07-16 20:09:01 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 16 Stefano Facchini 2013-07-16 20:23:54 UTC
You didn't really mean to push  a random 'src/nextmon' file, right? :)
Maybe you already know, but there's a useful tool by Owen Taylor for dealing with bugzilla patches, git-bz (http://fishsoup.net/software/git-bz/)
Comment 17 Robert Roth 2013-07-16 20:46:01 UTC
(In reply to comment #16)
> You didn't really mean to push  a random 'src/nextmon' file, right? :)
Thanks, I completely forgot that, and that's a file that wasn't pushed to the other branch, so, it got away :) 

> Maybe you already know, but there's a useful tool by Owen Taylor for dealing
> with bugzilla patches, git-bz (http://fishsoup.net/software/git-bz/)

No, I didn't know about that, but I'll check it out. My current workflow was to wget the patch file, and git apply, fix as necessary, git add and commit. Seems like git-bz will help me a bit there. Thanks for the tip.