Hi,
I use compositing window manager, so for now, when I move an window the server sends messages to clients to redraw itself in new position then clients redraw every widgets in new position which becomes slower when many widgets are present and sometimes the entire system crashes!! Is my method is correct?.. what method do you apply for window movement in compositor?...
What happens actually, when window is moved in compositing window manager?
Thanks in advance!!
GUI Window movement
-
- Member
- Posts: 43
- Joined: Sun Aug 20, 2017 10:59 am
Re: GUI Window movement
Why would you need to redraw every widget ?the server sends messages to clients to redraw itself in new position then clients redraw every widgets in new position
From my understanding there isn't a widget update needed, and as the display server must know the framebuffer, moving a window is just moving an array of pixels.
You don't need to update anything when moving a window (if you are not changing it's size)
You can just memcpy the pixel array of that window and clear/redraw background on the old position.
You don't even have to know which widgets/library is used by the client.
-
- Member
- Posts: 426
- Joined: Tue Apr 03, 2018 2:44 am
Re: GUI Window movement
A compositing window manager should provide each top level window with its own pixmap buffer, into which the application renders its widgets. The compositing window manager then blits that buffer to its final position on the screen. So moving a window on the screen should just be a blit of an already rendered buffer, no client redrawing necessary.Kamal123 wrote:Hi,
I use compositing window manager, so for now, when I move an window the server sends messages to clients to redraw itself in new position then clients redraw every widgets in new position which becomes slower when many widgets are present and sometimes the entire system crashes!! Is my method is correct?.. what method do you apply for window movement in compositor?...
What happens actually, when window is moved in compositing window manager?
Thanks in advance!!
Expose events are a throwback to when the screen framebuffer was the only place widgets were rendered, and made sense when video cards had 256KB RAM and machines didn't have enough main memory space or bandwidth to maintain an off screen pixmap for each top level window.
Re: GUI Window movement
Thanks, now my confusions are cleared. I fixed it...I have another question, I have pop-up menus, so if a popup menu is visible and after any menu item is clicked the popup menu disappears. If the popup menu disappears, how do I restore the contents behind it?..I am totally new to graphical widgets programing. I want to know the methods implemented in pop-up menus!!
Thanks in advance
Thanks in advance
Re: GUI Window movement
In most windowing environments, a pop-up menu is just another window (only without decoration), so it obscuring parts of other windows is just business as usual. When it goes away, either you saved the content of the obscured window and can restore it, or you send a message to the now visible window saying to redraw the damaged parts. In Windows, this is a WM_PAINT message, in X11 it is an XExposeEvent. The former method is not easy to do right, so a simple implementation probably just ought to go with the latter one.Kamal123 wrote:Thanks, now my confusions are cleared. I fixed it...I have another question, I have pop-up menus, so if a popup menu is visible and after any menu item is clicked the popup menu disappears. If the popup menu disappears, how do I restore the contents behind it?..I am totally new to graphical widgets programing. I want to know the methods implemented in pop-up menus!!
Carpe diem!
Re: GUI Window movement
Thank you so much, for your reply. I'll try to implement.nullplan wrote:In most windowing environments, a pop-up menu is just another window (only without decoration), so it obscuring parts of other windows is just business as usual. When it goes away, either you saved the content of the obscured window and can restore it, or you send a message to the now visible window saying to redraw the damaged parts. In Windows, this is a WM_PAINT message, in X11 it is an XExposeEvent. The former method is not easy to do right, so a simple implementation probably just ought to go with the latter one.Kamal123 wrote:Thanks, now my confusions are cleared. I fixed it...I have another question, I have pop-up menus, so if a popup menu is visible and after any menu item is clicked the popup menu disappears. If the popup menu disappears, how do I restore the contents behind it?..I am totally new to graphical widgets programing. I want to know the methods implemented in pop-up menus!!