gnustep / libs-back

The GNUstep gui library is a library of graphical user interface classes written completely in the Objective-C language; the classes are based upon Apple's Cocoa framework (which came from the OpenStep specification). *** Larger patches require copyright assignment to FSF. please file bugs here. ***
http://www.gnustep.org
GNU General Public License v3.0
50 stars 34 forks source link

Screens handling with RandR fixes #19

Closed trunkmaster closed 4 years ago

trunkmaster commented 4 years ago

In addition to the previous PR I've made some optiomizations and fixes:

fredkiefer commented 4 years ago

What I am currently unsure is whether we should move more of the code over to XGServer.m the actual screenList ivar gets handled there and maybe it would be better to have everything that deals with XRandR and X screens in one place and leave just stuff that handles NSScreens over here? I really don't know. Most of that confusion is already in the old code, still we could try to clean it up a bit.

trunkmaster commented 4 years ago

What I am currently unsure is whether we should move more of the code over to XGServer.m the actual screenList ivar gets handled there and maybe it would be better to have everything that deals with XRandR and X screens in one place and leave just stuff that handles NSScreens over here? I really don't know. Most of that confusion is already in the old code, still we could try to clean it up a bit.

I'm thinking about move all of the screen related methods into seaparate file - XGServerScreen.m? Plus rename all files into more convenient format +.m? First time I looked at x11 code I think every file contain class implementation not category - it's confusing. Also I'd like to make Xrandr library mandatory for backend and get rid of all these #ifdefs.

trunkmaster commented 4 years ago

@fredkiefer after some extensive testing I've found that current implementation of screen handling with XRandR is broken. The main reason is that window structure holds Xlib screen. With my multi-monitor implementation this field is filled with monitor number which is wrong.

The good news is that GNUstep application always has one Xlib screen (that's how backend initializes). Actually we could rely on defScreen (parsed from DISPLAY environment variable or contains 0). I need to check all places in Sources/x11 where screen is used and analyze if it's possible to replace it with defScreen.

I hope I'll find a solution during the weekend. I'll inform you after that.

trunkmaster commented 4 years ago

@fredkiefer, I'm finishing more comprehensive update to all this things. I hope I'll commit it today. Be There're huge number changes.

trunkmaster commented 4 years ago

@fredkiefer, sorry for such huge amount of changes. All of them was connected one by one...

fredkiefer commented 4 years ago

I went through the whole code once again and there are still a few places where I see a bit of confusion. With that resolved I would be fine with merging this.

trunkmaster commented 4 years ago

@fredkiefer, I plan to finish my "app menu follows key window" implementation (mostly in -gui). It's almost done, but has some flaws. Probably more fixes will go into -back.

trunkmaster commented 4 years ago

Just for the record, useful changes would be: