bahamondev / hide-titles

A Kwin script which hides window title when is maximized
GNU General Public License v3.0
13 stars 6 forks source link

What does `CsdManager` mean? #15

Closed renyuneyun closed 1 year ago

renyuneyun commented 1 year ago

I tried to understand the code and make improvements. The code is generally easy to understand. However, I don't quite understand why CsdManager is called Csd. What does this abbreviation mean?

In particular, this relates to how #13 should be fixed... Didn't want to introduce inconsistency to the expected functionality.

fin444 commented 1 year ago

My understanding of what CSD stands for is (Window) Client Side Display. Basically, some programs use the standard kwin top bar (window server side display), while others others use their own (window client side display). Using this script to manage programs that have their own causes a lot of bugs (search "firefox" in this repo's issues), so CsdManager makes sure that doesn't happen.

renyuneyun commented 1 year ago

Hmm, sounds like an interesting explanation. When I looked at the commit history, it seems CsdManager was introduced to deal with windows that were expected to come without border/title when started. But I didn't think about clients managing their own borders/titles. Out of curiosity, is "server-side display" and "client-side display" standard / de facto terminology?

I actually saw conflicting behaviours and/or histories about firefox and CsdManager. In my attempt, without it, firefox can correctly have its title hidden and restored. But with it, it's problematic.

fin444 commented 1 year ago

I don't believe it is official terminology, but IIRC I ran into the terms a couple times when researching Kwin scripts. I believe it comes from the fact that X is a window server, thus parts of the window that are controlled by the system are "server-side"?

I gave that explanation based on 3 month old memories of code I only like 90% understood, it could be inaccurate.

fin444 commented 1 year ago

https://develop.kde.org/docs/plasma/kwin/#clients

bahamondev commented 1 year ago

Csd stands for "Client side decorations" and yes that object is intended to manage clients that doesn't use kwin windows decorations but its own, allowing the script to avoid to put a window border on those clients when size is restored.