Bugzilla – Attachment 67664 Details for
Bug 103040
XEmacs shrinks in a loop
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
test.c
a.c (text/x-csrc), 1.94 KB, created by
Lubos Lunak
on 2006-02-10 16:42:20 UTC
(
hide
)
Description:
test.c
Filename:
MIME Type:
Creator:
Lubos Lunak
Created:
2006-02-10 16:42:20 UTC
Size:
1.94 KB
patch
obsolete
>#include <stdio.h> >#include <string.h> >#include <X11/Xlib.h> >#include <X11/Xatom.h> > >static int isWM( Display* dpy, Window rootwindow, const char* wmname ) > { > Atom type_ret; > int format_ret; > unsigned char *data_ret; > unsigned long nitems_ret, unused; > int iswm = 0; > Atom net_supporting_wm_check, utf8_string, net_wm_name; > if( dpy == NULL ) > return 0; > net_supporting_wm_check = XInternAtom( dpy, "_NET_SUPPORTING_WM_CHECK", False ); > utf8_string = XInternAtom( dpy, "UTF8_STRING", False ); > net_wm_name = XInternAtom( dpy, "_NET_WM_NAME", False ); > if( XGetWindowProperty( dpy, rootwindow, net_supporting_wm_check, > 0, 1, False, XA_WINDOW, &type_ret, &format_ret, &nitems_ret, &unused, &data_ret ) == Success > && data_ret != NULL ) > { > if( type_ret == XA_WINDOW && format_ret == 32 && nitems_ret == 1 ) > { > Window supportwindow = *((Window *) data_ret ); > unsigned char *name_ret; > if( supportwindow != None > && XGetWindowProperty( dpy, supportwindow, net_wm_name, 0, 1024, False, utf8_string, > &type_ret, &format_ret, &nitems_ret, &unused, &name_ret ) == Success > && name_ret != NULL ) > { > if( type_ret == utf8_string && format_ret == 8 ) > { // utf8 > int len = strlen( wmname ); > if( len <= nitems_ret && strncasecmp( (const char*)name_ret, wmname, len ) == 0 ) > iswm = 1; > } > XFree( name_ret ); > } > } > XFree( data_ret ); > } > return iswm; > } > >int main( int argc, char* argv[] ) > { > Display* dpy = XOpenDisplay( NULL ); > fprintf( stderr, "Metacity: %d\n", isWM( dpy, DefaultRootWindow( dpy ), "metacity" )); > fprintf( stderr, "KWin: %d\n", isWM( dpy, DefaultRootWindow( dpy ), "kwin" )); > XCloseDisplay( dpy ); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
Attachments on
bug 103040
:
53976
| 67664