I'd like to automatically hide a tmux pane as soon as it looses focus. Currently, I use 'Prefix+z' to manually maximize the current pane, hiding the unfocused pane. However, whenever I require to switch a little more often between panes, it becomes cumbersome to manually maximize. Is there a way to automatically hide unfocused panes?
I know this question exists: Tmux: Auto-hide panel when it loses focus
However, it does not answer my question.
You could put resizep -Z in the key bindings you use to change pane and window (you will likely need a check if it is already focused - you can use if-shell -F and the window_zoomed format for this).
Or maybe you could use the focus-in hook but I suspect that will be harder to get working.
Related
I've been trying to use FireFox as a simple window for a webpage that I will not be leaving, so I don't need the address-bar or close buttons, but I would like to keep my task bar visible (i.e. I do not want to simply go full screen). The gists of what I am trying to achieve is a "full window mode". Is there an add on that allows this? Preferably, I'd like an add on that can easily be turned on and off.
To elaborate, I may have the window only be half of the screen, so a full screen mode that leaves the task bar visible would not be sufficient.
You can come close to this with some simple JavaScript, just a bookmarklet, which will open the currently viewed URL in a window with most of the info/action bars hidden:
javascript:void(window.open(location.href,"_blank","outerWidth=1000,outerHeight=650,top=0,left=250,menubar=no,toolbar=no,location=no,personalbar=no,status=no"))
You can get close to maximized with specifying appropriate numbers for outerWidth=1000,outerHeight=650,top=0,left=250 which match your screen size, but you will not get quite what you can do when maximized.
You can then maximize the window. Which gives you:
Window.open requires chrome privileges in order to hide the titlebar and locationbar which means an add-on must do it. You can then use add-ons to get the rest of the way.
Using the Hide Caption Titlebar Plus add-on (with appropriate options selected) will get you to a maximized window of:
And with the addition of the add-on Hide Navigation Bar, maximized and hitting the default F2 to hide the locationbar you get:
Non-maximized:
You also asked that it provide removal of the various action/status/tool bars when not maximized. These add-ons will do so.
Easily turning them on and off:
Hide Navigation Bar only hides the location bar if you hit F2. Hide Caption Titlebar Plus is a restartless add-on and thus can be enabled/disabled at will from about:addons (Ctrl+Shift+A). It can also be set to mostly affect only maximized windows, so may not be something you need to enable/disable on a regular basis.
Personally, if this was something I wanted, I would set up a separate Firefox profile which has these add-ons and the home page as the one I wanted displayed. I would then set up a shortcut that automatically opens that page and shows what I want. You may need to use something like the add-on Session Manager to automatically restore the maximized window, but the default functionality in Firefox may be sufficient. In order to have a shortcut that brings up another Firefox profile automatically, you will need to set the Target to something like:
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -no-remote -P "your profile name"
This would allow you to bring up the page you wanted with a single click and not have the configuration disturb your normal use of Firefox. It would also be something that you would not need to mess around with enabling/disabling on a regular basis.
Many ways to do this:
There are, probably, many different combinations of add-ons which will get you to a similar look. There is, perhaps, even a single one which will do so. You should do some research on your own to find a combination that works for you. For the profile I was initially using to test, I did not need the Hide Navigation Bar add-on to hide the locationbar as that functionality was covered in a different add-on. However, if starting with a stock profile these two add-ons will get you to where it sounds like you want to be.
Taskbar is visible:
For all of the above images: If I had taken a shot of my entire desktop, you would see that that the Windows Taskbar is still visible (the Firefox window is just maximized, not full-screen). The above images are not full-screen for privacy reasons. I do not desire to share the windows I have open and my taskbar configuration. If I have the time later, I will re-take the window shots as full-screen shots after a clean re-boot.
I would like to add my custom command, to a window system menu (the one usually on the left top on titlebar, usually containing Minimize, Maximize and so on), and respond to it in my application.
In ms windows one can do
HMENU hMenu = GetSystemMenu(hwnd, false);
AppendMenu(hMenu, MF_STRING, ...)
Is something like this possible under X11? If not a general method maybe a solution for some specific window manager?
Ok, after your last edit, what I understand is that you want to add your custom menu to the menu that's on the window decoration, which is controlled by the Window Manager.
I don't think that's possible, although I'm not sure. I believe you should read the ICCCM and the EWMH to find if this is possible or not:
http://en.wikipedia.org/wiki/Inter-Client_Communication_Conventions_Manual
http://en.wikipedia.org/wiki/Extended_Window_Manager_Hints
Or you can send an email to wm-spec-list asking:
http://mail.gnome.org/mailman/listinfo/wm-spec-list
Also, adding an option there makes it quite hidden, doesn't it? I guess most people don't ever click that menu... I don't even think that menu exists on all the possible Window Managers. You should really try to put your menu inside your application's Window instead of the Window Manager's decoration. Some environments don't even have Window Managers: what would your users do in this case?
Note that some applications (like the Chromium browser) don't use the Window Manager decorations: they implement their own decoration, they implement their own close/maximize/minimize buttons. This way, they have complete control over all the decoration buttons and menus, but their decoration doesn't have the same "look and feel" of the rest of the desktop. You could think about doing this, but I wouldn't encourage that... You should probably put your menu somewhere else (where it's not that hidden...).
You mean you want to add your app to the system menu?
I believe most modern desktop environments implement the XDG Menu Standard:
http://standards.freedesktop.org/menu-spec/menu-spec-latest.html
You'll have to learn other standards too probably:
http://standards.freedesktop.org/
They're all somehow short, so they won't consume more than some hours to read and learn.
I have a desktop application written in Ruby that is using GTK2. It's just a small test application to play with GTK2, but I'm having problems achieving what I want to do. Is there any way using GTK2 to get at the titlebar (apart from setting the title), specifically to either add a button to it (beside the min/max/etc, B in the below diagram) or to add an option to the menu that pops up when you click the icon on the titlebar (A in the below diagram)?
I'm thinking there might not be because GTK is meant to work with many many different window managers, but I just wondered if there was. As a side question, what event does clicking the 'cross' button fire? At the moment if the user clicks that the window disappears but the program doesn't end - I need to capture that event and quit the program.
Thanks for any help, including hitting me over the head and telling me how silly I am.
Note that this is possible in GTK 3.10 and up, by using gtk_window_set_titlebar(). It replaces the window manager's title bar with a custom one. GtkHeaderBar is a good custom title bar class to use.
You can't, however, make it look just like the window manager would, because you won't know which window manager the user is running.
No, the title bar is owned by the window manager and you will typically not have direct access to it.
When the user tries to close the window by clicking the window manager's button, the window will receive the delete event.
Normally when creating a sub window (WS_POPUP), the child window will become activate and the parent will become deactivated. However, with menus, both remain active. At least I am assuming the menu is active, it at least has focus.
Example: Click on the file menu in notepad, the menu appears, yet the notepad window still looks active.
Is it possible to mirror this behavior with either a window style or responding to a particular message?
Thanks
Another example: Combo boxes seem to show a subwindow, yet do not deactivate the window. And you can click on that subwindow, while still maintaining an activate main window. Any ideas on how to grab the class /style of that window?
The list dropdown in a combobox is a bit of a hack, it is both a popup and a child window, I can't recommend that approach (Undocumented style combination, and IIRC, it is a bit buggy to do this with a "normal" floating window/toolbar)
This leaves you with two options:
WS_EX_NOACTIVATE (Main window will stay active, floating window is not active)
Handle activate messages (Both windows will look active)
I am surprised that creating a new popup window activates it. Normally you'd need to call SetActiveWindow. However check out WM_ACTIVATE and WM_NCACTIVATE on how to stop the window becoming deactivated.
A fact that a lot of people miss is that windows does not have a separate window manager component :- most of the window management duties are performed by each window - usually in DefWindowProc.
Most window positioning and activation / de-activation is done - ultimately - via a call to SetWindowPos - which always sends a WM_WINDOWPOSCHANGING message allowing the window to have a final say on what happens.
DefWindowProc also activate its own window in response to mouse clicks and so on.
The result of all this is, it is quite possible to create windows that never accept activation - it does require an extensive understanding of what messages and situations might have led to an activation.
Ultimately I can say that it is VERY handy to have a debugging setup configured for remote debugging - so that you can interact with your debugger without effecting the activation state of the system - and hence drop a breakpoint into the window in questions WM_ACTIVATE handler and simply debug any situation leading to an unwanted activation.
If You want to handle keyboard focus as well, it might be trickier - normally focus is given to an activated window - but again its usually the DefWindowProc responsible for assigning both. I just see it dangerous as having one window, still obviously activated, and another with focus. This will confuse any assistive software greatly.
I'd be tempted to perform a message loop level message hook - Similar to IsDialogMessage - to filter keystrokes intended for the popup window.
If you create your popup window with WS_EX_NOACTIVATE it will not be activated by user input (You could still activate it programatically) and therefore your main application window will still remain active.
Firefox has this nice find-a-text-on-the-page dialog, which is non-modal and shows up at the bottom of the window. How to do something similar using just Win32? I guess there has to edit control but do I have to position it manually on parent window WM_SIZE? How do I dismiss the dialog, i.e. how to make it disappear?
As said above, use a rebar and put an edit control and the buttons that you need on it. You'll have to manage all the rest yourself, manually (close button, showing/hiding it, etc.).
I guess that is what you call a rebar...http://msdn.microsoft.com/en-us/library/bb774373(VS.85).aspx. Google if you need more info...