| 1005 | } |
| 1006 | |
| 1007 | int XWindow::configure(U32 mask, XWindowChanges* changes) { |
| 1008 | bool sizeChanged = false; |
| 1009 | U32 width = this->width(); |
| 1010 | U32 height = this->height(); |
| 1011 | |
| 1012 | if (mask & CWX) { |
| 1013 | left = changes->x; |
| 1014 | sizeChanged = true; |
| 1015 | } |
| 1016 | if (mask & CWY) { |
| 1017 | top = changes->y; |
| 1018 | sizeChanged = true; |
| 1019 | } |
| 1020 | if (mask & CWWidth) { |
| 1021 | width = changes->width; |
| 1022 | sizeChanged = true; |
| 1023 | } |
| 1024 | if (mask & CWHeight) { |
| 1025 | height = changes->height; |
| 1026 | sizeChanged = true; |
| 1027 | } |
| 1028 | if (mask & CWBorderWidth) { |
| 1029 | border_width = changes->border_width; |
| 1030 | } |
| 1031 | if (mask & CWSibling) { |
| 1032 | kpanic("XReconfigureWMWindow CWSibling not handled"); |
| 1033 | } |
| 1034 | if (mask & CWStackMode) { |
| 1035 | if (parent) { |
| 1036 | BOXEDWINE_CRITICAL_SECTION_WITH_MUTEX(parent->childrenMutex); |
| 1037 | int index = vectorIndexOf(parent->zchildren, shared_from_this()); |
| 1038 | if (index >= 0 && index < (int)parent->zchildren.size() - 1) { |
| 1039 | parent->zchildren.erase(parent->zchildren.begin() + index); |
| 1040 | parent->zchildren.push_back(shared_from_this()); |
| 1041 | } |
| 1042 | } |
| 1043 | } |
| 1044 | if (sizeChanged) { |
| 1045 | if (width != this->width() || height != this->height()) { |
| 1046 | setSize(width, height); |
| 1047 | } |
| 1048 | KNativeSystem::moveWindow(shared_from_this()); |
| 1049 | } |
| 1050 | configureNotify(); |
| 1051 | // :TODO: |
| 1052 | if (c_class == InputOutput && isMapped) { |
| 1053 | XServer::getServer()->iterateEventMask(id, ExposureMask, [this](const DisplayDataPtr& data) { |
| 1054 | exposeNofity(data, 0, 0, this->width(), this->height(), 0); |
| 1055 | }); |
| 1056 | } |
| 1057 | return Success; |
| 1058 | } |
| 1059 | |
| 1060 | |
| 1061 | bool XWindow::isTransient() { |
no test coverage detected