444 #endif |
444 #endif |
445 |
445 |
446 SetWindowBordered(display, screen, w, |
446 SetWindowBordered(display, screen, w, |
447 (window->flags & SDL_WINDOW_BORDERLESS) == 0); |
447 (window->flags & SDL_WINDOW_BORDERLESS) == 0); |
448 |
448 |
|
449 sizehints = XAllocSizeHints(); |
449 /* Setup the normal size hints */ |
450 /* Setup the normal size hints */ |
450 sizehints.flags = 0; |
451 sizehints->flags = 0; |
451 if (!(window->flags & SDL_WINDOW_RESIZABLE)) { |
452 if (!(window->flags & SDL_WINDOW_RESIZABLE)) { |
452 sizehints.min_width = sizehints.max_width = window->w; |
453 sizehints->min_width = sizehints->max_width = window->w; |
453 sizehints.min_height = sizehints.max_height = window->h; |
454 sizehints->min_height = sizehints->max_height = window->h; |
454 sizehints.flags |= (PMaxSize | PMinSize); |
455 sizehints->flags |= (PMaxSize | PMinSize); |
455 } |
456 } |
456 sizehints.x = window->x; |
457 sizehints->x = window->x; |
457 sizehints.y = window->y; |
458 sizehints->y = window->y; |
458 sizehints.flags |= USPosition; |
459 sizehints->flags |= USPosition; |
459 |
460 |
460 /* Setup the input hints so we get keyboard input */ |
461 /* Setup the input hints so we get keyboard input */ |
461 wmhints.input = True; |
462 wmhints = XAllocWMHints(); |
462 wmhints.flags = InputHint; |
463 wmhints->input = True; |
|
464 wmhints->flags = InputHint; |
463 |
465 |
464 /* Setup the class hints so we can get an icon (AfterStep) */ |
466 /* Setup the class hints so we can get an icon (AfterStep) */ |
465 classhints.res_name = data->classname; |
467 classhints = XAllocClassHint(); |
466 classhints.res_class = data->classname; |
468 classhints->res_name = data->classname; |
|
469 classhints->res_class = data->classname; |
467 |
470 |
468 /* Set the size, input and class hints, and define WM_CLIENT_MACHINE and WM_LOCALE_NAME */ |
471 /* Set the size, input and class hints, and define WM_CLIENT_MACHINE and WM_LOCALE_NAME */ |
469 XSetWMProperties(display, w, NULL, NULL, NULL, 0, &sizehints, &wmhints, &classhints); |
472 XSetWMProperties(display, w, NULL, NULL, NULL, 0, sizehints, wmhints, classhints); |
470 |
473 |
|
474 XFree(sizehints); |
|
475 XFree(wmhints); |
|
476 XFree(classhints); |
471 /* Set the PID related to the window for the given hostname, if possible */ |
477 /* Set the PID related to the window for the given hostname, if possible */ |
472 if (data->pid > 0) { |
478 if (data->pid > 0) { |
473 _NET_WM_PID = XInternAtom(display, "_NET_WM_PID", False); |
479 _NET_WM_PID = XInternAtom(display, "_NET_WM_PID", False); |
474 XChangeProperty(display, w, _NET_WM_PID, XA_CARDINAL, 32, PropModeReplace, |
480 XChangeProperty(display, w, _NET_WM_PID, XA_CARDINAL, 32, PropModeReplace, |
475 (unsigned char *)&data->pid, 1); |
481 (unsigned char *)&data->pid, 1); |