Active Topics

 


Reply
Thread Tools
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#1
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:
[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:
<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.
Attached Files
File Type: gz top_killa.gz (1.8 KB, 96 views)
 

The Following 8 Users Say Thank You to qwerty12 For This Useful Post:
fpp's Avatar
Posts: 2,853 | Thanked: 968 times | Joined on Nov 2005
#2
I hadn't even *seen* the new option in the menu... thanks ! :-)
__________________
maemo blog
 
Posts: 236 | Thanked: 223 times | Joined on Oct 2009 @ NE UK
#3
Originally Posted by qwerty12 View Post
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 ..?

Originally Posted by qwerty12 View Post
If anyone actually wants the source to this boring and short program, let me know.
Please and thankyou!
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#4
Originally Posted by kwotski View Post
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.
 

The Following User Says Thank You to qwerty12 For This Useful Post:
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#5
Originally Posted by kwotski View Post
Please and thankyou!
http://slexy.org/view/s2vgm8gPIB
 

The Following User Says Thank You to qwerty12 For This Useful Post:
tuminoid's Avatar
Posts: 188 | Thanked: 185 times | Joined on Dec 2009 @ Finland
#6
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.
__________________
My wiki: User:Tuminoid
cpumem-applet: home | packages - status: 0.0.3 in Extras

cell-modem-ui: home | packages - status: 0.5.1-1 in Extras
nowplayingd: home | packages - status: 0.1-2 in extras-devel
custom-pwkmenu: home - no packages yet.
 

The Following User Says Thank You to tuminoid For This Useful Post:
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#7
Originally Posted by tuminoid View Post
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...

Last edited by qwerty12; 2009-12-20 at 17:16.
 
tuminoid's Avatar
Posts: 188 | Thanked: 185 times | Joined on Dec 2009 @ Finland
#8
Originally Posted by qwerty12 View Post
Systemui sends a _NET_CLOSE_WINDOW request to the toplevel window.
I consider that "asking nicely", its WM that kills stuff.
__________________
My wiki: User:Tuminoid
cpumem-applet: home | packages - status: 0.0.3 in Extras

cell-modem-ui: home | packages - status: 0.5.1-1 in Extras
nowplayingd: home | packages - status: 0.1-2 in extras-devel
custom-pwkmenu: home - no packages yet.
 

The Following User Says Thank You to tuminoid For This Useful Post:
Posts: 236 | Thanked: 223 times | Joined on Oct 2009 @ NE UK
#9
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
 

The Following User Says Thank You to kwotski For This Useful Post:
Posts: 13 | Thanked: 0 times | Joined on May 2010
#10
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?
 
Reply


 
Forum Jump


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