Dirty areas in gui

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Kamal123
Member
Member
Posts: 99
Joined: Fri Nov 01, 2019 1:17 am

Dirty areas in gui

Post by Kamal123 »

Hi, In compositing window manager, how clients tells the window manager for each dirty areas to repaint? Does it sends a list of rectangles to server? Or server detects dirty areas by pixel comparison of previous rendered image and currently rendering image?
How do live games updates each dirty areas? If clients sends dirty list every time, then server side will become slow!!...
User avatar
mid
Member
Member
Posts: 31
Joined: Thu Mar 04, 2021 7:25 am

Re: Dirty areas in gui

Post by mid »

In my design, clients only handle the main content and respond to events, analogous to HTML & JavaScript in a web page. The server is what handles all of the drawing and layouting. In the case clients absolutely need to draw manually, they send drawing commands to the server or, in the worst case, send one "update entire window" command when needed.
Kamal123 wrote:If clients sends dirty list every time, then server side will become slow!!...
Usually games redraw the entire screen each frame anyway (and they must if using perspective 3D) so this is only a problem if you're considering very old hardware. EDIT: Or huge framebuffers.
Last edited by mid on Sun Sep 26, 2021 3:49 pm, edited 1 time in total.
Kamal123
Member
Member
Posts: 99
Joined: Fri Nov 01, 2019 1:17 am

Re: Dirty areas in gui

Post by Kamal123 »

mid wrote:In my design, clients only handle the main content and respond to events, analogous to HTML & JavaScript in a web page. The server is what handles all of the drawing and layouting. In the case clients absolutely need to draw manually, they send drawing commands to the server or, in the worst case, send one "update entire window" command when needed.
Kamal123 wrote:If clients sends dirty list every time, then server side will become slow!!...
Usually games redraw the entire screen each frame anyway (and they must if using perspective 3D) so this is only a problem if you're considering very old hardware.
Thanks for your reply, what happens if two or more clients are sending dirty area update message to the server at same time? Server can't handle two messages at same time. How do you solve that problem?
User avatar
mid
Member
Member
Posts: 31
Joined: Thu Mar 04, 2021 7:25 am

Re: Dirty areas in gui

Post by mid »

Kamal123 wrote:Thanks for your reply, what happens if two or more clients are sending dirty area update message to the server at same time? Server can't handle two messages at same time. How do you solve that problem?
Well, the simple answer is that it can't be at the same time. Either you use a synchronous model where the first task to run will send the message first, and thus interrupt the server first, or you use an asynchronous model where the server will have to process the messages serially.
Kamal123
Member
Member
Posts: 99
Joined: Fri Nov 01, 2019 1:17 am

Re: Dirty areas in gui

Post by Kamal123 »

mid wrote:
Kamal123 wrote:Thanks for your reply, what happens if two or more clients are sending dirty area update message to the server at same time? Server can't handle two messages at same time. How do you solve that problem?
Well, the simple answer is that it can't be at the same time. Either you use a synchronous model where the first task to run will send the message first, and thus interrupt the server first, or you use an asynchronous model where the server will have to process the messages serially.
Hi, thank you, I have implemented a model in which some clients tell the server to draw the window in every frames and second model is that some window which don't require live updates will send dirty rectangles to the server, for specific areas to be updated. Suppose I have a 2d game running, which requires live updates, then it will tell the server to set the live update bit and render the window in every frames, for which my mouse cursor movement become slow. How do you fix mouse movement speed, even when the whole screen is updating? I use dirty areas for mouse movement, like old position gets repainted. How do you make mouse movements smooth , while whole screen is updating?
User avatar
mid
Member
Member
Posts: 31
Joined: Thu Mar 04, 2021 7:25 am

Re: Dirty areas in gui

Post by mid »

Kamal123 wrote:Hi, thank you, I have implemented a model in which some clients tell the server to draw the window in every frames and second model is that some window which don't require live updates will send dirty rectangles to the server, for specific areas to be updated. Suppose I have a 2d game running, which requires live updates, then it will tell the server to set the live update bit and render the window in every frames, for which my mouse cursor movement become slow. How do you fix mouse movement speed, even when the whole screen is updating? I use dirty areas for mouse movement, like old position gets repainted. How do you make mouse movements smooth , while whole screen is updating?
I can't really help you here, since we're delving into implementation details. Does it (the mouse) become slow overall or only when in front of the game?
Kamal123
Member
Member
Posts: 99
Joined: Fri Nov 01, 2019 1:17 am

Re: Dirty areas in gui

Post by Kamal123 »

mid wrote:
Kamal123 wrote:Hi, thank you, I have implemented a model in which some clients tell the server to draw the window in every frames and second model is that some window which don't require live updates will send dirty rectangles to the server, for specific areas to be updated. Suppose I have a 2d game running, which requires live updates, then it will tell the server to set the live update bit and render the window in every frames, for which my mouse cursor movement become slow. How do you fix mouse movement speed, even when the whole screen is updating? I use dirty areas for mouse movement, like old position gets repainted. How do you make mouse movements smooth , while whole screen is updating?
I can't really help you here, since we're delving into implementation details. Does it (the mouse) become slow overall or only when in front of the game?
Only in front of games where screen update is occurring at every frame. But for normal windows, movement of cursor is smooth. I use ps/2 mouse
Post Reply