| 1551 | // ---------------------------------------------------------------------------------------- |
| 1552 | |
| 1553 | base_window:: |
| 1554 | base_window ( |
| 1555 | bool resizable_, |
| 1556 | bool undecorated |
| 1557 | ) : |
| 1558 | x11_stuff(*(new gui_core_kernel_2_globals::x11_base_windowstuff)), |
| 1559 | is_mapped(false), |
| 1560 | resizable(resizable_), |
| 1561 | has_been_destroyed(false), |
| 1562 | has_been_resized(false), |
| 1563 | has_been_moved(false), |
| 1564 | wm(gui_core_kernel_2_globals::global_data()->window_table.get_mutex()) |
| 1565 | { |
| 1566 | DLIB_ASSERT(!(undecorated == true && resizable_ == true), |
| 1567 | "\tbase_window::base_window()" |
| 1568 | << "\n\tThere is no such thing as an undecorated window that is resizable by the user." |
| 1569 | << "\n\tthis: " << this |
| 1570 | ); |
| 1571 | using namespace gui_core_kernel_2_globals; |
| 1572 | |
| 1573 | auto_mutex M(wm); |
| 1574 | |
| 1575 | x11_stuff.globals = global_data(); |
| 1576 | |
| 1577 | x11_stuff.last_click_time = 0; |
| 1578 | last_click_x = 0; |
| 1579 | last_click_y = 0; |
| 1580 | last_click_button = NONE; |
| 1581 | |
| 1582 | XSetWindowAttributes attr; |
| 1583 | memset(&attr,'\0',sizeof(attr)); |
| 1584 | |
| 1585 | unsigned long valuemask = 0; |
| 1586 | if (undecorated) |
| 1587 | { |
| 1588 | attr.override_redirect = True; |
| 1589 | valuemask = CWOverrideRedirect; |
| 1590 | } |
| 1591 | |
| 1592 | |
| 1593 | x11_stuff.hwnd = XCreateWindow( |
| 1594 | x11_stuff.globals->disp, |
| 1595 | DefaultRootWindow(x11_stuff.globals->disp), |
| 1596 | 0, |
| 1597 | 0, |
| 1598 | 10, // this is the default width of a window |
| 1599 | 10, // this is the default width of a window |
| 1600 | 0, |
| 1601 | x11_stuff.globals->depth, |
| 1602 | InputOutput, |
| 1603 | CopyFromParent, |
| 1604 | valuemask, |
| 1605 | &attr |
| 1606 | ); |
| 1607 | |
| 1608 | x11_stuff.xic = NULL; |
| 1609 | if (x11_stuff.globals->xim) |
| 1610 | { |
nothing calls this directly
no test coverage detected