16.04 - How can I prevent a window from automatically maximising in Ubuntu Unity? - Ask Ubuntu


the following animation demonstrates how unable prevent window automatically maximising in ubuntu 16.04 unity upon opening.

gif animation

comizconfig settings manager has "place windows" plugin can configure newly-opened windows should placed. below screenshot example of setup google chrome placement.

enter image description here

if doesn't work, here's alternative solution. script below runs continuously , prevents maximizing of window in focus.

#!/usr/bin/env python # # # author: serg kolo , contact: 1047481448@qq.com # date: oct 27, 2016 # purpose: prevents x11 windows form maximizing # written for: http://askubuntu.com/q/842317/295286 # tested on: ubuntu 16.04 lts # # copyright: serg kolo , 2016 # #     permission use, copy, modify, , distribute software hereby granted #     without fee, provided  copyright notice above , permission statement #     appear in copies. # #     software provided "as is", without warranty of kind, express or #     implied, including not limited warranties of merchantability, #     fitness particular purpose , noninfringement.  in no event shall #     authors or copyright holders liable claim, damages or other #     liability, whether in action of contract, tort or otherwise, arising #     from, out of or in connection software or use or other #     dealings in software. __future__ import print_function import gi gi.require_version('gdk', '3.0') gi.repository import gdk, gio import subprocess import signal import time   def run_cmd(cmdlist):     """ reusable function running shell commands"""     try:         stdout = subprocess.check_output(cmdlist)     except subprocess.calledprocesserror:         pass     else:         if stdout:             return stdout   def main():     """ defines entry point of program """     screen = gdk.screen.get_default()     while true:         active_window = screen.get_active_window()         active_xid = str(active_window.get_xid())         wm_state = run_cmd(             ['xprop', '-root', '-notype', '-id', active_xid, '_net_wm_state'])         if ('_net_wm_state_maximized_vert' in wm_state ,                 '_net_wm_state_maximized_horz' in wm_state):             active_window.unmaximize()             active_window.process_all_updates()         time.sleep(0.25)  if __name__ == "__main__":     main() 

Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User