cosmos72/twin

Where's the docs & native X11 decorations

Opened this issue · 5 comments

Sorry to drop this here. This isn't specifically a "bug". I don't seem to have any other way to contact you and I tried emailing your address that's in the source about documentation matters. But I never received a reply. I'm new to TWIN. TWIN is something I've been thinking about writing since about '88. Thanks! It looks really good. But it needs a bunch more documentation.

To start with: on the SF.net project page you have this screen shot:

Twin on X11 ... in ShinyMetal...

Looks like the E16 ShinyMetal theme. I like E16. :-)

I don't see any way to make the X11 viewer background clear. How did you do this? It doesn't look to be a whole bunch of individual TWIN displays... or there'd be more "menu bars". It would be really nice to have my TWIN windows intermixed with my X11 windows. Especially since I plan to have multiple TWIN "displays" from multiple servers on my desktop at the same time. It would be nice if they could coexist instead of one set taking precedence over the others.

Anyhow I don't see this feature documented anywhere. I'd also like to know how best to get started writing TWIN programs. Most of the docs seem to say they are incomplete and I don't seem to see anything that documents how to get started writing TWIN apps. I saw the "demo*.c" programs in the "clients" folder but they don't build and apparently neither does the "libTT", that they depend on. Is "libTT" discontinued?

Thanks for writing TWIN. I'm looking forward to putting it to use.

Hi @jafcobend,
the old email ..@linux.sns.it has been disabled many years ago - writing here is currently the best way to contact me :)

The screenshot you posted above uses twin --hw=gfx - it was an "enhanced" X11 driver with themable window borders.
I removed it two years ago, in favor of the new user-contributed twin --hw=xft X11 driver that uses antialiased fonts.
If there is enough interest, I can resurrect and reintegrate it.
You can browse the themes that were available at https://github.com/cosmos72/twin/tree/1404ce3696c0d582d1782f8dc798683f107747e7/themes/hw_gfx

I don't see any way to make the X11 viewer background clear.

In the screenshot above, twin --hw=gfx was configured to show an image as its background - no transparency was involved.

It would be really nice to have my TWIN windows intermixed with my X11 windows

If I understand correctly, you are asking about a "seamless mode", where each window inside twin becomes a window inside an X11 server - it's currently not supported.
I thought a bit about it, and implementing it is feasible in theory, but requires quite a lot of work.

I'd also like to know how best to get started writing TWIN programs. Most of the docs seem to say
they are incomplete and I don't seem to see anything that documents how to get started writing TWIN apps.
I saw the "demo*.c" programs in the "clients" folder but they don't build and apparently neither does the "libTT",
that they depend on. Is "libTT" discontinued?

Yes, libTT is discontinued. It was an ambitious idea that I never managed to complete.

Also, the clients folder inside the main repository only contains very basic clients - you would not learn much from them.

I'd suggest you to have a look at some slightly more sophisticated clients at https://github.com/cosmos72/twutils

The screenshot you posted above uses twin --hw=gfx - it was an "enhanced" X11 driver with themable window borders.
I removed it two years ago, in favor of the new user-contributed twin --hw=xft X11 driver that uses antialiased fonts.
If there is enough interest, I can resurrect and reintegrate it.

Thanks for the reply. I don't suppose you know which commit was the last that had hw_gfx? I might like to poke at it. Since it seems I'm the only who's asked about it there likely isn't any real interest. I think it might be fun.

I really wanted what you call "seamless mode". I thought it might be difficult to implement. I'll be content with what I have. :-)

... you would not learn much from them.

That's how you begin to learn larger systems. Start at the surface (simple) and work your way down (complex, more features). So simple examples are very productive in terms of bringing new devs in. I started dissecting sysmon.

Yes, libTT is discontinued.

I would recommend that you remove the discontinued bits like libTT, demo*.c and any other abandoned bits. It helps us who are trying to learn the system not to get caught on dead-end roads. With GIT you can place them in topic specific branches if you think you might want to be able to come back to them.

I'd suggest you to have a look at some slightly more sophisticated clients at https://github.com/cosmos72/twutils

Hmm... yes... Well, TwKalc, at least, won't build. Not a good example to follow. Apparently the TW++ lib is broken... At least in v0.9.0 (ff76a04) or maybe its just incompatible. I'll be looking into that in the next few weeks, as time permits, as its either re-use your C++ interface or write my own. But it looks like you posted some patch to that file about 45mins ago. Perhaps you noticed and fixed the problem?

I don't suppose you know which commit was the last that had hw_gfx?

Commit 1404ce3 is the last one that contains hw_gfx. I linked it in the previous message too.

I would recommend that you remove the discontinued bits like libTT, demo*.c and any other abandoned bits

Yes, it makes sense. They can be recovered from older commits if needed.

But it looks like you posted some patch to that file about 45mins ago. Perhaps you noticed and fixed the problem?

Exactly. I pushed fixes to both twin and twutils repositories. TwKalc now works correctly,
but there's still a bug when closing it (twin server seems to hang).

Bug fixed in commit bf0c7eb:
a destructor in twin_server was not cleaning up correctly, causing a use-after-free and an infinite loop - triggered for example by closing TwKalc

Thanks! I'll have to give these a try!