Re: [gdm-list] Running a gtk application at GDM login screen



Hi Brian,

Thanks for your quick reply. The first method you explained below i have already tried. In fact my application right now i'm running using a script named :0 in /etc/gdm/Init. However this gets invoked only when the gdm starts, means after a logout or restart. Let me explain some detail about my application. The application actually doesn't have gui interface, but it uses some of the gtk/gdk/gnome APIs, what it does is like similar to gnome-display-properties. It takes display configurations( like resolution, rotation, refresh rate, span) from a remote network and setting the display of connected outputs( monitors ) attached to my machine, by generating monitors.xml. So i need to invoke this application in the background when the network comes up ( using network dispatcher script ) .�

Creating a .desktop file in�/usr/share/gdm/autostart/LoginWindow would work when we are at gdm login screen. In my case network may not come up at the gdm login screen. So the display configuration will not be available to apply using .desktop file. After user logs in, in the session, network comes up and gets the configuration and we can apply this via gnome autostart file. However user may not login immediately. If he waits for sometime at gdm login screen, and during that time network comes up and gets the configuration and trying to run the application while the user is at gdm login screen. But it fails to open the display. I have gone through the code of gnome-display-properties, it also starts with gtk_init() call. and even the gnome-display-properties applet is available at gdm login screen also ( at the bottom panel ). If we are to able open�gnome-display-properties at gdm login window, why my application fails to open the display when it gets invoked in the background. Do i need to run this as "gdm" user?. �Is there any way to trigger the autostart .desktop file while the network comes up?
Or do we have alternate way to do this. Please advice.

Thanks,
-Renju

On Fri, Feb 25, 2011 at 1:20 AM, Brian Cameron <brian cameron oracle com> wrote:

Renju:

How are you trying to run the application? �There are two ways I
know of that you can do this.

You can run programs by launching them in the GDM Init script
(/etc/gdm/Init/Default). �The Init script blocks, so if you launch
your GUI this way, the login GUI won't show up until your program
exits. �This can be desirable in some cases like if you want to
present the user with a click-through agreement before presenting
the login GUI. �You can get programs started in the Init script to
run at the same time as the login GUI if you run them in the background
by putting a "&" at the end of the command.

But, if you want the program to run while the login GUI is running,
then it might make more sense to add a desktop file in the following
directory:

�/usr/share/gdm/autostart/LoginWindow

Programs that are started this way are launched by the gnome-session
process that is running as the "gdm" user while the login GUI is being
shown. �In fact, this mechanism is used to run the login GUI itself.

Brian

I'm trying to run a gtk based application which does some monitor
resolution configuration based on the no of outputs( monitors )
connected to my machine. The application runs when the network brings up
and during this time user may be at login screen or in a session. When
user is in a session it works fine, however if we are at gdm login
screen, this fails to open the display. I'm using the APIs like
gtk_init(), gdk_screen_get_default() etc.. in my application. Even i set
the DISPLAY using setenv, it doesn't work ( setenv( DISPLAY, ":0", 1).
The gdm version i'm using is gdm-2.24.0.

Could anyone help me to figure out why it fails to open display at gdm
login screen

Thanks,
-Renju



_______________________________________________
gdm-list mailing list
gdm-list gnome org
http://mail.gnome.org/mailman/listinfo/gdm-list




--
Regards
-Renju


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]