maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   End current task - extreme (https://talk.maemo.org/showthread.php?t=37860)

qwerty12 2009-12-20 12:29

End current task - extreme
 
1 Attachment(s)
The End current task addition to the power off menu is a nice one. But it's too "nice" for my liking - it just sent a close window request. I disliked that. I wanted the program to be killed. Enter "top_killa".

Abusing systemui's ability to run processes via D-Bus, this program will kill the program which has its toplevel window on the screen.

1. gunzip top_killa.gz into /usr/bin
2. Put the following into /usr/share/dbus-1/services/com.qwerty12.top_killa.service:
Quote:

[D-BUS Service]
Name=com.qwerty12.top_killa
Exec=/usr/bin/top_killa
3. Find the "powerup_memain_endcurrenttask" section in /etc/systemui/systemui.xml and add the following:
Quote:

<callback service="com.qwerty12.top_killa" path="/com/qwerty12/top_killa" interface="com.qwerty.top_killa" method="top_application" bus="session" autostart="true">
<argument type="boolean">true</argument>
</callback>
4. Reboot and, now, using End current task will kill the program instead of just waiting for to end and giving you a "Do you want to close <whatever>?" after 20 years.

If anyone actually wants the source to this boring and short program, let me know.

fpp 2009-12-20 12:31

Re: End current task - extreme
 
I hadn't even *seen* the new option in the menu... thanks ! :-)

kwotski 2009-12-20 13:31

Re: End current task - extreme
 
Quote:

Originally Posted by qwerty12 (Post 435238)
3. Find the "powerup_memain_endcurrenttask" section in /etc/systemui/systemui.xml and add the following:

Could you be a bit more explicit about how you add this? I currently have:

Code:

<menuitem priority="600" name="powerup_memain_endcurrenttask">
  <return>10</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>

Do I add yours between the <menuitem> tags, or ..?

Quote:

Originally Posted by qwerty12 (Post 435238)
If anyone actually wants the source to this boring and short program, let me know.

Please and thankyou!

qwerty12 2009-12-20 13:42

Re: End current task - extreme
 
Quote:

Originally Posted by kwotski (Post 435270)
Could you be a bit more explicit about how you add this? I currently have:

Code:

<menuitem priority="600" name="powerup_memain_endcurrenttask">
  <return>10</return>
  <po>osso-powerup-shutdown</po>
 </menuitem>

Do I add yours between the <menuitem> tags, or ..?

I put it after the return tags, like this: http://slexy.org/view/s21Wsg3jWi

I'll upload the source in a few hours (sorry, I won't be able to get to my computer before then) but all the program does is get the X11 root window, get the value of the "_MB_CURRENT_APP_WINDOW" property and get the value of the "_NET_WM_PID" property using the XID given by the current app window property.

qwerty12 2009-12-20 16:08

Re: End current task - extreme
 
Quote:

Originally Posted by kwotski (Post 435270)
Please and thankyou!

http://slexy.org/view/s2vgm8gPIB

tuminoid 2009-12-20 16:55

Re: End current task - extreme
 
Actually its not systemui that kills the task (its run as user, it doesn't have privileges to do it), but window manager. Why it takes so long to kill something (and some cases fail) is it plays ping-pong with target app with WM_PINGs and only non responding apps get booted.

This is revised in upcoming service release and SIGKILL is used to guarantee killing is done properly.

qwerty12 2009-12-20 16:57

Re: End current task - extreme
 
Quote:

Originally Posted by tuminoid (Post 435426)
Actually its not systemui that kills the task (its run as user, it doesn't have privileges to do it), but window manager. Why it takes so long to kill something (and some cases fail) is it plays ping-pong with target app with WM_PINGs and only non responding apps get booted.

Systemui sends a _NET_CLOSE_WINDOW request to the toplevel window.

Although you do raise a good point about being root... Maybe I should make top_killa setuid...

tuminoid 2009-12-20 17:37

Re: End current task - extreme
 
Quote:

Originally Posted by qwerty12 (Post 435428)
Systemui sends a _NET_CLOSE_WINDOW request to the toplevel window.

I consider that "asking nicely", its WM that kills stuff. :)

kwotski 2009-12-20 18:38

Re: End current task - extreme
 
Thanks for the source, qwerty12.

Also, just to report that I've installed this as indicated and tested it (once! on the browser) with every indication of success.

Also: great app name ;)

jarmniku 2010-06-10 10:45

End current task - basic
 
Hi!
I have a self-made application that doesn't get the "End current task" onto the power-switch menu. Because of that, it failed Ovi-testing (plus one another problem). How do I get the menu item for my X-Window application?


All times are GMT. The time now is 19:23.

vBulletin® Version 3.8.8