Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I know that title bar of windows can be removed in {g,d}conf-editor or by modifying the metacity theme. However, I want to have some rather complex rules for showing title bars or not (like hide the title bar if the window is tiled) and an extension is the only way I can think of to do this. MetaWindow.get_frame doesn't seem to be accessible in js, is there a way to control the decoration of windows in a gnome-shell extension?

THX.

share|improve this question
add comment

1 Answer 1

You need to use a tool like devilspie which will allow you to match windows and perform actions on them, such as modifying the hints on the window to remove the display of the title bar. You could also instead write a program or script using the libwnck library's API to match windows and apply such changes to them.

share|improve this answer
    
Well, my problem is not how to filter the window I want to deal with (which can be done easily in an extension), but how to apply the action I want. Is it possible to use either devilspie or libwnck (libwnck3 maybe) to modify the decoration of window? I have looked through the documentation of libwnck3 and didn't find any api on that (thx for pointing out this wonderful library though =P). I suppose what I need require a metacity/mutter-only api? –  yuyichao Apr 3 '12 at 16:33
    
If you get the WnckWindow for the window you want to modify, you can call set_window_type to change the window type to another type so that the borders do not get displayed for it, using the Wnck API from introspection. I don't know if it's usable from JS though. –  dobey Apr 3 '12 at 18:44
    
I c. I will take it as a workaround then (since changing the window type might has other side effect, can be noticed by client and might be theme-dependent, correct me if I am wrong.). Yes, Wnck (and wnck3) has gir and can be accessed in gnome-shell js. –  yuyichao Apr 3 '12 at 19:01
    
It's not a workaround. It is theme dependent, and changing the window type is the only way to tell the WM that a window shouldn't have borders/titlebar. A theme can of course still draw them anyway, but most do the right thing in the right places. There is no other way to tell the WM to only hide the titlebar, but draw all other decorations, for a single window, according to the WM spec. –  dobey Apr 3 '12 at 19:35
    
Sorry if I didn't state my question clearly. What I want to do is to tell gnome-shell(mutter) not to put a title bar in an gnome-shell extension. I don't mean to tell random wm when I don't want to have a title bar. The extension (or gnome-shell) IS the wm, or at least can control the wm directly and what I want to know is whether there is a mutter api for this. meta_window_get_frame() should return the decoration frame of the window (which I suppose can help with what I want to do), but it doesn't seem to be accessible through gi. –  yuyichao Apr 3 '12 at 20:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.