Merge lp:~ara/mago/tweaks into lp:~mago-contributors/mago/mago-1.0

Proposed by Ara Pulido
Status: Merged
Merged at revision: not available
Proposed branch: lp:~ara/mago/tweaks
Merge into: lp:~mago-contributors/mago/mago-1.0
Diff against target: None lines
To merge this branch: bzr merge lp:~ara/mago/tweaks
Reviewer Review Type Date Requested Status
Javier Collado (community) Approve
Review via email: mp+7445@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Ara Pulido (ara) wrote :

Generating a keyevent like "<ctrl><alt>d" to minimize all the windows in the screen is not very robust (sometimes it fails) and it dependent on the user's configuration.

This change propose to use wnck to minimize the windows. This works robustly and it is configuration independent.

Revision history for this message
Javier Collado (javier.collado) wrote :

Hello,

I've never used wcnk library (is there any documentation available?), but I've tried the code in my laptop and it's worked fine.

Best regards,
    Javier

review: Approve
Revision history for this message
Joker Wild (lajjr-deactivatedaccount) wrote :

Javier,

> I've never used wcnk library (is there any documentation available?), but I've
> tried the code in my laptop and it's worked fine.
I found this for you I hope it helps.
http://library.gnome.org/devel/libwnck/stable/

Regards,
Leo

Revision history for this message
Javier Collado (javier.collado) wrote :

> Javier,
>
> > I've never used wcnk library (is there any documentation available?), but
> I've
> > tried the code in my laptop and it's worked fine.
> I found this for you I hope it helps.
> http://library.gnome.org/devel/libwnck/stable/
>
> Regards,
> Leo

Thanks Leo. I now see that part of the problem was that I wasn't spelling correctly the name of the library.

Revision history for this message
Ara Pulido (ara) wrote :

The documentation Leo provided, is the C library. I haven't found any documentation for the python bindings.

Revision history for this message
Nagappan Alagappan (nagappan) wrote :

Hi Ara,

I think, this is the best way to do.

Thanks
Nagappan

On Mon, Jun 15, 2009 at 1:50 AM, Ara Pulido <email address hidden> wrote:

> Ara Pulido has proposed merging lp:~apulido/mago/tweaks into lp:mago.
>
> Requested reviews:
> Mago Contributors (mago-contributors)
>
> Generating a keyevent like "<ctrl><alt>d" to minimize all the windows in
> the screen is not very robust (sometimes it fails) and it dependent on the
> user's configuration.
>
> This change propose to use wnck to minimize the windows. This works
> robustly and it is configuration independent.
> --
> https://code.launchpad.net/~apulido/mago/tweaks/+merge/7445<https://code.launchpad.net/%7Eapulido/mago/tweaks/+merge/7445>
> You are subscribed to branch lp:mago.
>

--
Linux Desktop (GUI Application) Testing Project -
http://ldtp.freedesktop.org
http://nagappanal.blogspot.com

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mago/application/deskex.py'
2--- mago/application/deskex.py 2009-05-14 09:29:37 +0000
3+++ mago/application/deskex.py 2009-06-15 08:41:09 +0000
4@@ -1,4 +1,5 @@
5 from .main import Application
6+from ..utils import minimize_all_windows
7 from time import time, sleep
8 import tempfile
9 import pynotify
10@@ -137,11 +138,11 @@
11 self.focus_desktop = focus_desktop
12
13 if self.focus_desktop:
14- ldtp.generatekeyevent('<alt><ctrl>d')
15+ minimize_all_windows()
16
17 def close(self):
18 if self.focus_desktop:
19- ldtp.generatekeyevent('<alt><ctrl>d')
20+ minimize_all_windows()
21 for screenshot in self.screenshots:
22 if os.path.exists(screenshot):
23 os.remove(screenshot)
24
25=== modified file 'mago/utils.py'
26--- mago/utils.py 2009-05-06 09:35:24 +0000
27+++ mago/utils.py 2009-06-15 08:41:09 +0000
28@@ -1,4 +1,16 @@
29 import os
30+import gtk, gobject, wnck
31+
32+def minimize_all_windows():
33+ def start_minimizing():
34+ for w in screen.get_windows():
35+ w.minimize()
36+
37+
38+ screen = wnck.screen_get_default()
39+ gobject.idle_add(start_minimizing)
40+ gobject.idle_add(gtk.main_quit)
41+ gtk.main()
42
43 def get_system_language():
44 raise NotImplementedError, "not yet..."

Subscribers

People subscribed via source and target branches

to status/vote changes: