Como posso evitar que uma janela seja maximizada automaticamente no Ubuntu Unity?

0

A animação a seguir demonstra como não consigo impedir que uma janela seja maximizada automaticamente no Ubuntu 16.04 Unity ao abrir.

    
por orschiro 27.10.2016 / 11:00

1 resposta

1

O Gerenciador de configurações do ComizConfig tem um plug-in "Place Windows", no qual você pode configurar onde as janelas recém-abertas devem ser colocadas. Abaixo está um exemplo de captura de tela da minha configuração para o posicionamento do Google Chrome.

Seissonãofuncionar,aquiestáumasoluçãoalternativa.Oscriptabaixoéexecutadocontinuamenteeimpedeamaximizaçãodajanelaemfoco.

#!/usr/bin/env python # # # Author: Serg Kolo , contact: [email protected] # 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 to use, copy, modify, and distribute this software is hereby granted # without fee, provided that the copyright notice above and this permission statement # appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. from __future__ import print_function import gi gi.require_version('Gdk', '3.0') from gi.repository import Gdk, Gio import subprocess import signal import time def run_cmd(cmdlist): """ reusable function for running shell commands""" try: stdout = subprocess.check_output(cmdlist) except subprocess.CalledProcessError: pass else: if stdout: return stdout def main(): """ defines entry point of the 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 and '_NET_WM_STATE_MAXIMIZED_HORZ' in wm_state): active_window.unmaximize() active_window.process_all_updates() time.sleep(0.25) if __name__ == "__main__": main()     
por Sergiy Kolodyazhnyy 28.10.2016 / 01:43