Hi,
I am developing a desktop application for Linux using C and X library functions.
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 windows 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 application 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 = 0;
struct {
long flags;
long functions;
long decorations;
long inputMode;
long status;
}MWMHints = { MWM_HINTS_DECORATIONS, 0, 0, 0,0};
g_display = XOpenDisplay(NULL);
if(g_display == NULL)
{
ERROR; return;
}
i_screen = DefaultScreen(g_display);
visual = DefaultVisual(g_display, i_screen);
i_depth = DefaultDepth(g_display, i_screen);
win_attr.background_pixel = XWhitePixel(g_display, i_screen);
i_width=800;
i_height=600;
ul_vmask = CWBackPixel;
g_window = XCreateWindow( g_display, XRootWindow(g_display, i_screen),
0, 0, i_width, i_height, 0, i_depth, InputOutput,
visual, ul_vmask, &win_attr);
cmap=DefaultColormap(g_display, i_screen);
XSetWindowColormap(g_display,g_window,cmap);
size_hints.flags = PSize | PMinSize | PMaxSize;
size_hints.min_width = i_width;
size_hints.max_width = i_width;
size_hints.min_height = i_height;
size_hints.max_height = i_height;
XSetStandardProperties(g_display, g_window, "ADR Image Display", "icon_name", None,0, 0, &size_hints);
/* Remove Window Border and Title Bar */
/* First try for MWM Hints */
wm_hints = XInternAtom(g_display, "_MOTIF_WM_HINTS", True);
if ( wm_hints != None ) {printf("\nMOTIF\n");
XChangeProperty(g_display, g_window, wm_hints, wm_hints, 32,
PropModeReplace, (unsigned char *)&MWMHints,
sizeof(MWMHints)/sizeof(long));
}
/* Now try to set KWM hints */
wm_hints = XInternAtom(g_display, "KWM_WIN_DECORATION", True);
&nbs
p; if (
wm_hints != None ) {printf("\nKWM\n");
XChangeProperty(g_display, g_window, wm_hints, wm_hints, 32,
PropModeReplace, (unsigned char *)&KWMHints,
sizeof(KWMHints)/sizeof(long));
}
wm_hints = XInternAtom(g_display, "_WIN_HINTS", True);
if ( wm_hints != None ) {
long GNOMEHints = 0;printf("\nGNOME\n");
XChangeProperty(g_display, g_window, wm_hints, wm_hints, 32,
PropModeReplace, (unsigned char *)&GNOMEHints,
sizeof(GNOMEHints)/4);
}
-----------------------
Regards,
Rajendra