void xf_rail_CreateWindow(rdpRail* rail, rdpWindow* window) { xfInfo* xfi; xfWindow* xfw; xfWindow* xfparent; xfi = (xfInfo*) rail->extra; xfparent = NULL; if (window->ownerWindowId != 0) { rdpWindow* p = NULL; p = window_list_get_by_id(xfi->rail->list, window->ownerWindowId); if (p != NULL) xfparent = (xfWindow*) p->extra; } xfw = xf_CreateWindow((xfInfo*) rail->extra, xfparent, window->windowOffsetX, window->windowOffsetY, window->windowWidth, window->windowHeight, window->windowId); xf_SetWindowStyle(xfi, xfw, window->style, window->extendedStyle); XStoreName(xfi->display, xfw->handle, window->title); window->extra = (void*) xfw; window->extraId = (void*) xfw->handle; }
static void xf_rail_CreateWindow(rdpRail* rail, rdpWindow* window) { xfContext* xfc; xfWindow* xfw; xfc = (xfContext*) rail->extra; xf_rail_enable_remoteapp_mode(xfc); xfw = xf_CreateWindow(xfc, window, window->windowOffsetX, window->windowOffsetY, window->windowWidth, window->windowHeight, window->windowId); xf_SetWindowStyle(xfc, xfw, window->style, window->extendedStyle); xf_SetWindowText(xfc, xfw, window->title); window->extra = (void*) xfw; window->extraId = (void*) xfw->handle; }
void xf_rail_CreateWindow(rdpRail* rail, rdpWindow* window) { xfInfo* xfi; xfWindow* xfw; xfi = (xfInfo*) rail->extra; xf_rail_enable_remoteapp_mode(xfi); xfw = xf_CreateWindow((xfInfo*) rail->extra, window, window->windowOffsetX, window->windowOffsetY, window->windowWidth, window->windowHeight, window->windowId); xf_SetWindowStyle(xfi, xfw, window->style, window->extendedStyle); XStoreName(xfi->display, xfw->handle, window->title); window->extra = (void*) xfw; window->extraId = (void*) xfw->handle; }
int xf_AppWindowInit(xfContext* xfc, xfAppWindow* appWindow) { XGCValues gcv; int input_mask; XWMHints* InputModeHint; XClassHint* class_hints; xf_FixWindowCoordinates(xfc, &appWindow->x, &appWindow->y, &appWindow->width, &appWindow->height); appWindow->decorations = FALSE; appWindow->fullscreen = FALSE; appWindow->local_move.state = LMS_NOT_ACTIVE; appWindow->is_mapped = FALSE; appWindow->is_transient = FALSE; appWindow->rail_state = 0; appWindow->rail_ignore_configure = FALSE; appWindow->handle = XCreateWindow(xfc->display, RootWindowOfScreen(xfc->screen), appWindow->x, appWindow->y, appWindow->width, appWindow->height, 0, xfc->depth, InputOutput, xfc->visual, 0, &xfc->attribs); if (!appWindow->handle) return -1; ZeroMemory(&gcv, sizeof(gcv)); appWindow->gc = XCreateGC(xfc->display, appWindow->handle, GCGraphicsExposures, &gcv); class_hints = XAllocClassHint(); if (class_hints) { char* class = NULL; if (xfc->context.settings->WmClass) { class_hints->res_class = xfc->context.settings->WmClass; } else { class = malloc(sizeof("RAIL:00000000")); sprintf_s(class, sizeof("RAIL:00000000"), "RAIL:%08"PRIX32"", appWindow->windowId); class_hints->res_class = class; } class_hints->res_name = "RAIL"; XSetClassHint(xfc->display, appWindow->handle, class_hints); XFree(class_hints); free(class); } /* Set the input mode hint for the WM */ InputModeHint = XAllocWMHints(); InputModeHint->flags = (1L << 0); InputModeHint->input = True; XSetWMHints(xfc->display, appWindow->handle, InputModeHint); XFree(InputModeHint); XSetWMProtocols(xfc->display, appWindow->handle, &(xfc->WM_DELETE_WINDOW), 1); input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask | Button1MotionMask | Button2MotionMask | Button3MotionMask | Button4MotionMask | Button5MotionMask | ButtonMotionMask | KeymapStateMask | ExposureMask | VisibilityChangeMask | StructureNotifyMask | SubstructureNotifyMask | SubstructureRedirectMask | FocusChangeMask | PropertyChangeMask | ColormapChangeMask | OwnerGrabButtonMask; XSelectInput(xfc->display, appWindow->handle, input_mask); xf_SetWindowDecorations(xfc, appWindow->handle, appWindow->decorations); xf_SetWindowStyle(xfc, appWindow, appWindow->dwStyle, appWindow->dwExStyle); xf_SetWindowPID(xfc, appWindow->handle, 0); xf_ShowWindow(xfc, appWindow, WINDOW_SHOW); XClearWindow(xfc->display, appWindow->handle); XMapWindow(xfc->display, appWindow->handle); /* Move doesn't seem to work until window is mapped. */ xf_MoveWindow(xfc, appWindow, appWindow->x, appWindow->y, appWindow->width, appWindow->height); xf_SetWindowText(xfc, appWindow, appWindow->title); return 1; }