Window Switching problem in Full Screen Application.

Rajendrakumar Malode <[email protected]> Tue, 12 Jul 2005 18:32:08 -0700 (PDT)
Newsgroups gmane.comp.gnome.os.redhat
Message-ID <[email protected]>
--===============1514209089==
Content-Type: multipart/alternative; boundary="0-1083845113-1121218328=:68206"
Content-Transfer-Encoding: 7bit

--0-1083845113-1121218328=:68206
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable


Hi,

I am developing a desktop application for Linux using C and X library fun=
ctions.

My application always runs in full screen mode(no caption bar and window =
decoration).

My requirement is, I should be able to switch to other application window=
s by pressing alt+tab key even when my application is running.

I use Redhat 8.

It works fine on Redhat 8 KDE.

But the problem is only with GNOME. - Im not able to switch to other appl=
ication windows by using alt+tab key.

More over this problem occures only when my screen resolution is 800X600

My target PC has Redhat 8.0  and has only GNOME.

Im attaching the code here for your reference..Please help me to fix the =
problem.

------------------------

    Atom wm_hints;
    long KWMHints =3D 0;
        struct {
            long flags;
            long functions;
            long decorations;
            long inputMode;
            long status;
            }MWMHints =3D { MWM_HINTS_DECORATIONS, 0, 0, 0,0};


    g_display =3D XOpenDisplay(NULL);

    if(g_display =3D=3D NULL)
    {
     ERROR; return;
    }

    i_screen =3D DefaultScreen(g_display);

    visual =3D DefaultVisual(g_display, i_screen);
    i_depth =3D DefaultDepth(g_display, i_screen);

    win_attr.background_pixel =3D XWhitePixel(g_display, i_screen);

    i_width=3D800;
    i_height=3D600;

    ul_vmask =3D CWBackPixel;


    g_window =3D XCreateWindow( g_display, XRootWindow(g_display, i_scree=
n),
                            0, 0, i_width, i_height, 0, i_depth, InputOut=
put,
                            visual, ul_vmask, &win_attr);

    cmap=3DDefaultColormap(g_display, i_screen);

    XSetWindowColormap(g_display,g_window,cmap);

    size_hints.flags =3D PSize | PMinSize | PMaxSize;
    size_hints.min_width =3D i_width;
    size_hints.max_width =3D i_width;
    size_hints.min_height =3D i_height;
    size_hints.max_height =3D i_height;

    XSetStandardProperties(g_display, g_window, "ADR Image Display", "ico=
n_name", None,0, 0, &size_hints);

    /* Remove Window Border and Title Bar */
    /* First try for MWM Hints */
    wm_hints =3D XInternAtom(g_display, "_MOTIF_WM_HINTS", True);
    if ( wm_hints !=3D None ) {printf("\nMOTIF\n");
    XChangeProperty(g_display, g_window, wm_hints, wm_hints, 32,
                                PropModeReplace, (unsigned char *)&MWMHin=
ts,
                                sizeof(MWMHints)/sizeof(long));
    }
    /* Now try to set KWM hints */
    wm_hints =3D XInternAtom(g_display, "KWM_WIN_DECORATION", True);
    if ( wm_hints !=3D None ) {printf("\nKWM\n");
    XChangeProperty(g_display, g_window, wm_hints, wm_hints, 32,
                                PropModeReplace, (unsigned char *)&KWMHin=
ts,
                                sizeof(KWMHints)/sizeof(long));
    }

   wm_hints =3D XInternAtom(g_display, "_WIN_HINTS", True);
    if ( wm_hints !=3D None ) {
        long GNOMEHints =3D 0;printf("\nGNOME\n");
        XChangeProperty(g_display, g_window, wm_hints, wm_hints, 32,
                        PropModeReplace, (unsigned char *)&GNOMEHints,
                        sizeof(GNOMEHints)/4);
    }


-----------------------

Regards,

Rajendra


	=09
---------------------------------
Do you Yahoo!?
 Yahoo! Mail - You care about security. So do we.
--0-1083845113-1121218328=:68206
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<P>Hi,</P>
<P>I am developing a desktop application for Linux using C and X library =
functions.</P>
<P>My application always runs in full screen mode(no caption bar and wind=
ow decoration).</P>
<P>My requirement is, I should be able to switch to other application win=
dows by pressing alt+tab key even when my application is running.</P>
<P>I use Redhat 8.</P>
<P>It works fine on Redhat 8 KDE.</P>
<P>But the problem is only with GNOME. - Im not able to switch to other a=
pplication windows by using alt+tab key.</P>
<P>More over this problem occures only when my screen resolution is 800X6=
00</P>
<P>My target PC has Redhat 8.0&nbsp; and has only GNOME.</P>
<P>Im attaching the code here for your reference..Please help me to fix t=
he problem.</P>
<P>------------------------</P>
<P>&nbsp;&nbsp;&nbsp; Atom wm_hints;<BR>&nbsp;&nbsp;&nbsp; long KWMHints =
=3D 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; struct {<BR>&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long flags;<BR=
>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long =
functions;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp; long decorations;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp; long inputMode;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long status;<BR>&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }MWMHints =3D { MWM_HINTS_D=
ECORATIONS, 0, 0, 0,0};</P>
<P><BR>&nbsp;&nbsp;&nbsp; g_display =3D XOpenDisplay(NULL);</P>
<P>&nbsp;&nbsp;&nbsp; if(g_display =3D=3D NULL)<BR>&nbsp;&nbsp;&nbsp; {<B=
R>&nbsp;&nbsp;&nbsp;&nbsp; ERROR; return;<BR>&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp;&nbsp; i_screen =3D DefaultScreen(g_display);</P>
<P>&nbsp;&nbsp;&nbsp; visual =3D DefaultVisual(g_display, i_screen);<BR>&=
nbsp;&nbsp;&nbsp; i_depth =3D DefaultDepth(g_display, i_screen);</P>
<P>&nbsp;&nbsp;&nbsp; win_attr.background_pixel =3D XWhitePixel(g_display=
, i_screen);</P>
<P>&nbsp;&nbsp;&nbsp; i_width=3D800;<BR>&nbsp;&nbsp;&nbsp; i_height=3D600=
;</P>
<P>&nbsp;&nbsp;&nbsp; ul_vmask =3D CWBackPixel;</P>
<P><BR>&nbsp;&nbsp;&nbsp; g_window =3D XCreateWindow( g_display, XRootWin=
dow(g_display, i_screen),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0, 0, i_width, i_height, 0,=
 i_depth, InputOutput,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; visual, ul_vmask, &amp;win_att=
r);</P>
<P>&nbsp;&nbsp;&nbsp; cmap=3DDefaultColormap(g_display, i_screen);</P>
<P>&nbsp;&nbsp;&nbsp; XSetWindowColormap(g_display,g_window,cmap);</P>
<P>&nbsp;&nbsp;&nbsp; size_hints.flags =3D PSize | PMinSize | PMaxSize;<B=
R>&nbsp;&nbsp;&nbsp; size_hints.min_width =3D i_width;<BR>&nbsp;&nbsp;&nb=
sp; size_hints.max_width =3D i_width;<BR>&nbsp;&nbsp;&nbsp; size_hints.mi=
n_height =3D i_height;<BR>&nbsp;&nbsp;&nbsp; size_hints.max_height =3D i_=
height;</P>
<P>&nbsp;&nbsp;&nbsp; XSetStandardProperties(g_display, g_window, "ADR Im=
age Display", "icon_name", None,0, 0, &amp;size_hints);</P>
<P>&nbsp;&nbsp;&nbsp; /* Remove Window Border and Title Bar */<BR>&nbsp;&=
nbsp;&nbsp; /* First try for MWM Hints */<BR>&nbsp;&nbsp;&nbsp; wm_hints =
=3D XInternAtom(g_display, "_MOTIF_WM_HINTS", True);<BR>&nbsp;&nbsp;&nbsp=
; if ( wm_hints !=3D None ) {printf("\nMOTIF\n");<BR>&nbsp;&nbsp;&nbsp; X=
ChangeProperty(g_display, g_window, wm_hints, wm_hints, 32,<BR>&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PropModeReplace, (unsigned char *)&amp;MWM=
Hints,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sizeof(MWMHints)/sizeo=
f(long));<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; /* Now try to set=
 KWM hints */<BR>&nbsp;&nbsp;&nbsp; wm_hints =3D XInternAtom(g_display, "=
KWM_WIN_DECORATION", True);<BR>&nbsp;&nbsp;&nbs
 p; if (
 wm_hints !=3D None ) {printf("\nKWM\n");<BR>&nbsp;&nbsp;&nbsp; XChangePr=
operty(g_display, g_window, wm_hints, wm_hints, 32,<BR>&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp; PropModeReplace, (unsigned char *)&amp;KWMHints,<B=
R>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sizeof(KWMHints)/sizeof(long))=
;<BR>&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp; wm_hints =3D XInternAtom(g_display, "_WIN_HINTS", True);<=
BR>&nbsp;&nbsp;&nbsp; if ( wm_hints !=3D None ) {<BR>&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp; long GNOMEHints =3D 0;printf("\nGNOME\n");<BR>&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; XChangeProperty(g_display, g_windo=
w, wm_hints, wm_hints, 32,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp; PropModeReplace, (unsigned char *)&amp;GNOMEHints,=
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; siz=
eof(GNOMEHints)/4);<BR>&nbsp;&nbsp;&nbsp; }</P>
<P><BR>-----------------------</P>
<P>Regards,</P>
<P>Rajendra<BR></P><p>
		<hr size=3D1>Do you Yahoo!?<br>=20
<a href=3D"http://us.rd.yahoo.com/mail_us/taglines/security/*http://promo=
tions.yahoo.com/new_mail/static/protection.html">Yahoo! Mail</a> - You ca=
re about security. So do we.
--0-1083845113-1121218328=:68206--

--===============1514209089==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
gnome-redhat-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnome-redhat-list

--===============1514209089==--