back/ericwa-experimental: remove nativewindow for now

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/branches/ericwa-experimental@34147 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Eric Wasylishen 2011-11-09 21:39:13 +00:00
parent 94c2c544b5
commit 661d409586

View file

@ -1532,101 +1532,7 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
- (int) nativeWindow: (void *)winref : (NSRect*)frame : (NSBackingStoreType*)type
: (unsigned int*)style : (int*)screen
{
gswindow_device_t *window;
gswindow_device_t *root;
XWindowAttributes win_attributes;
Window windowRef;
NSRect xframe;
windowRef = *((Window*)winref);
NSDebugLLog(@"XGTrace", @"nativeWindow: %lu", windowRef);
if (!XGetWindowAttributes(dpy, windowRef, &win_attributes))
{
return 0;
}
*screen = XScreenNumberOfScreen(win_attributes.screen);
*type = NSBackingStoreNonretained;
*style = NSBorderlessWindowMask;
root = [self _rootWindowForScreen: *screen];
/* Create the window structure and set the style early so we can use it to
convert frames. */
window = NSAllocateCollectable(sizeof(gswindow_device_t), NSScannedOption);
memset(window, '\0', sizeof(gswindow_device_t));
window->display = dpy;
window->screen = *screen;
window->ident = windowRef;
window->root = root->ident;
window->parent = root->ident;
window->type = *type;
window->win_attrs.flags |= GSWindowStyleAttr;
window->win_attrs.window_style = *style;
window->border = win_attributes.border_width;
window->depth = win_attributes.depth;
window->xframe = NSMakeRect(win_attributes.x, win_attributes.y,
win_attributes.width, win_attributes.height);
window->xwn_attrs.colormap = win_attributes.colormap;
window->xwn_attrs.save_under = win_attributes.save_under;
window->xwn_attrs.override_redirect = win_attributes.override_redirect;
window->map_state = win_attributes.map_state;
window->visibility = -1;
window->wm_state = [self _wm_state: windowRef];
/*
* Initial attributes for any GNUstep window tell Window Maker not to
* create an app icon for us.
*/
window->win_attrs.flags |= GSExtraFlagsAttr;
window->win_attrs.extra_flags |= GSNoApplicationIconFlag;
/*
* Prepare size/position hints, but don't set them now - ordering
* the window in should automatically do it.
*/
*frame = [self _XFrameToOSFrame: window->xframe for: window];
// Use the globally active input mode
window->gen_hints.flags = InputHint;
window->gen_hints.input = False;
// All the windows of a GNUstep application belong to one group.
window->gen_hints.flags |= WindowGroupHint;
window->gen_hints.window_group = ROOT;
window->exposedRects = [NSMutableArray new];
window->ic = 0;
/*
* Prepare size/position hints, but don't set them now - ordering
* the window in should automatically do it.
*/
xframe = [self _XFrameToXHints: window->xframe for: window];
window->siz_hints.x = NSMinX(xframe);
window->siz_hints.y = NSMinY(xframe);
window->siz_hints.width = NSWidth(xframe);
window->siz_hints.height = NSHeight(xframe);
window->siz_hints.flags = USPosition|PPosition|USSize|PSize;
// make sure that new window has the correct cursor
[self _initializeCursorForXWindow: window->ident];
/*
* FIXME - should this be protected by a lock for thread safety?
* generate a unique tag for this new window.
*/
do
{
last_win_num++;
}
while (last_win_num == 0 || WINDOW_WITH_TAG(last_win_num) != 0);
window->number = last_win_num;
// Insert window into the mapping
NSMapInsert(windowmaps, (void*)(uintptr_t)window->ident, window);
NSMapInsert(windowtags, (void*)(uintptr_t)window->number, window);
[self _setWindowOwnedByServer: window->number];
return window->number;
return 0;
}
- (void) termwindow: (int)win