MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / Resize

Method Resize

LibLemon/src/gui/window.cpp:104–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102 }
103
104 void Window::Resize(vector2i_t size){
105 Lemon::UnmapSharedMemory(windowBufferInfo, windowBufferKey);
106
107 surface.buffer = buffer1;
108 surface.width = size.x;
109 surface.height = size.y;
110
111 if(menuBar){
112 rootContainer.SetBounds({{0, 16}, {size.x, size.y - WINDOW_MENUBAR_HEIGHT}});
113 } else {
114 rootContainer.SetBounds({{0, 0}, size});
115 }
116
117 rootContainer.UpdateFixedBounds();
118
119 windowBufferKey = WMClient::Resize(size.x, size.y);
120 if(windowBufferKey <= 0){
121 printf("[LibLemon] Warning: Window::Resize: Failed to obtain window buffer!\n");
122 return;
123 }
124
125 windowBufferInfo = (WindowBuffer*)Lemon::MapSharedMemory(windowBufferKey);
126
127 windowBufferInfo->currentBuffer = 0;
128 buffer1 = ((uint8_t*)windowBufferInfo) + windowBufferInfo->buffer1Offset;
129 buffer2 = ((uint8_t*)windowBufferInfo) + windowBufferInfo->buffer2Offset;
130
131 Paint();
132 }
133
134 void Window::SwapBuffers(){
135 if(windowBufferInfo->drawing) return;

Callers

nothing calls this directly

Calls 7

UnmapSharedMemoryFunction · 0.85
PaintFunction · 0.85
SetBoundsMethod · 0.80
DecodeMethod · 0.80
MapSharedMemoryFunction · 0.50
MessageClass · 0.50
UpdateFixedBoundsMethod · 0.45

Tested by

no test coverage detected