You are not logged in.
I am unsure if this is programming related, or what.. but:
I am programming something and when I run it I have no visible window manager. This is probably because I use DWM. However, when I compile and run this on a machine with a DE the application has a window manager bar, such as GTK, or what ever the DE uses. My question is, how in my setup (DWM or in any DE-less environment) can we force an application to use a title bar/window manager bar such as GTK?
Offline
Firstly, we've got to get some terminology straight :-)
I think what you're referring to is usually called one of several things:
- A client's parent window.
- A client's decorations.
- A client's extents.
- A client's frame.
Also, GTK is a GUI toolkit... Like Qt, tkinter, or wxWidgets. They are not responsible for a client's decorations. Traditionally (with the famous exception being Chrome), window managers create those decorations by re-parenting the window you create.
Usually, tiling window managers don't bother with decorations (although, they may still re-parent the client for other reasons).
In short, you can't "force" your application to use a title bar, unless you physically create one yourself (again, like Chrome... and they do it so tabs can be at the very top). I don't think toolkits do this, since window managers traditionally do this manually.
You don't need to have a DE to have window decorations. If you were just running Openbox, you would see a title bar too.
If a window manager doesn't create decorations for you, you need to create your own (probably from scratch, unless a toolkit exists to do this for you, but I'm not aware of any). This is a non-trivial task that would probably require low level X programming (using Xlib or XCB). If you want to pursue this venue, I'd be happy to give you a few pointers. (I am building a re-parenting window manager right now.)
Education is favorable to liberty. Freedom can exist only in a society of knowledge. Without learning, men are incapable of knowing their rights, and where learning is confined to a few people, liberty can be neither equal nor universal.
Tu ne cede malis sed contra audentior ito
Offline
You could look into Xnest.
Offline
^That may help me test things, thanks.
I am unsure the best way to handle the problem itself. I may try a few methods. Thanks!
Offline
In addition to Xnest, Xephyr works similarly, but also supports some of the more modern X extensions (like composite). For example:
Xephyr :1 -ac -fullscreen -br &
DISPLAY=:1 openbox
Will open a window with openbox running as the WM.
You can also run the X server on another tty, and switch to using Ctrl + Alt + F7 or above. For example, switch to tty1, Ctrl + Alt + F1, and run:
xinit .xinitrc2 -- :1
Which will run .xinitrc2 instead of .xinitrc. You can then switch back to your original X instance using Ctrl + Alt + F7, and then switch back to your test environment using Ctrl + Alt + F8.
What exactly are you trying to do? (i.e., why do you need/want the title bar?) Maybe there's another way :-)
Last edited by BurntSushi (2011-01-19 00:40:27)
Education is favorable to liberty. Freedom can exist only in a society of knowledge. Without learning, men are incapable of knowing their rights, and where learning is confined to a few people, liberty can be neither equal nor universal.
Tu ne cede malis sed contra audentior ito
Offline
You shouldn't need to program a title bar. What are you trying to do?
Personally, I'd rather be back in Hobbiton.
Offline
There are good reasons you don't have a titlebar in DWM and have one in GNOME. The most important one is that the user decided he wanted or didn't want his windows to have those. As BurntSushi said, Titlebars exist for doing stuff with the window that the window manager needs to care about (like moving them around or closing them). DWM doesn't need these titlebars since there are other ways to care about window handling, like shortcuts. Also, since Titlebars are handled by the window manager, they aren't associated in any way with the content of the window they are displaying, and that's why you should explain why you need this titlebar so badly? If it's just for moving/closing the window - Every window manager cares about that no matter whether there are title bars, so you don't need to do so and shouldn't do so unless you want to piss off the users.
Offline