sebastien / pywo

Automatically exported from code.google.com/p/pywo
GNU General Public License v3.0
0 stars 0 forks source link

Pywo crashes when trying to tile window #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run pywo
2. Use shortcut to tile window

What is the expected output? What do you see instead?

pywo should move the window according to the shortcut. 

Pywo exits with the following error

$ python pywo.py 
Xlib.protocol.request.QueryExtension
Starting PyWO...
Loading configuration file...
Configuration loaded.
PyWO ready and running!
^[^C^CException in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/home/user/Software/pywo-0.1.1/core.py", line 236, in run
    self.__dispatch(self.__display.next_event())
  File "/home/user/Software/pywo-0.1.1/core.py", line 295, in __dispatch
    handlers[event.type].handle_event(event)
  File "/home/user/Software/pywo-0.1.1/events.py", line 86, in handle_event
    self.__mapping[event.type](event)
  File "pywo.py", line 207, in key_press
    window = WM.active_window()
  File "/home/user/Software/pywo-0.1.1/core.py", line 833, in active_window
    return Window(window_id)
  File "/home/user/Software/pywo-0.1.1/core.py", line 524, in __init__
    self.__translate_coords, self.__adjust_geometry = self.__check()
  File "/home/user/Software/pywo-0.1.1/core.py", line 528, in __check
    name = WindowManager().name.lower()
  File "/home/user/Software/pywo-0.1.1/core.py", line 782, in name
    name = win.get_property('_NET_WM_NAME')
  File "/home/user/Software/pywo-0.1.1/core.py", line 343, in get_property
    property = self._win.get_full_property(atom, 0)
  File "/usr/lib/pymodules/python2.6/Xlib/xobject/drawable.py", line 459, in get_full_property
    prop = self.get_property(property, type, 0, sizehint)
  File "/usr/lib/pymodules/python2.6/Xlib/xobject/drawable.py", line 448, in get_property
    long_length = length)
  File "/usr/lib/pymodules/python2.6/Xlib/protocol/rq.py", line 1428, in __init__
    self.reply()
  File "/usr/lib/pymodules/python2.6/Xlib/protocol/rq.py", line 1448, in reply
    raise self._error
BadWindow: <class 'Xlib.error.BadWindow'>: code = 3, resource_id = 
Xlib.xobject.resource.Resource(0x0180007b), sequence_number = 491, major_opcode 
= 20, minor_opcode = 0

Exception KeyboardInterrupt in <module 'threading' from 
'/usr/lib/python2.6/threading.pyc'> ignored

What version of the product are you using? On what operating system?

Pywo-all versions, Kubuntu 10.10, KDE 4.6.2, python 4.6,

Please provide any additional information below.
python-xlib installed

Original issue reported on code.google.com by flavioza...@gmail.com on 8 Jun 2011 at 8:47

GoogleCodeExporter commented 8 years ago
Does it happen in development version from the repository?

I've just tried running Kubuntu 10.04 and 10.10 in VirtualBox, tried both 
pywo-0.2 and development version and everything worked correctly. 

Could you paste output of "pywo debug" (if you are using development version) 
or after starting pywo press shortcut for debug informations.

The only thing that comes to my mind now is that pywo is connecting to wrong 
Display. Try running in python interpreter:
import Xlib.display
dsp = Xlib.display.Display()
dsp.get_display_name()

and check if it matches:
echo $DISPLAY

Original comment by kosci...@gmail.com on 12 Jun 2011 at 5:08

GoogleCodeExporter commented 8 years ago
It happens also with the development version. I tried using different window 
decorations and different widget styles, but it didn't solve anything. PyWO 
used to work for me in my previous install (32 bit kubuntu now I'm using 64 
bit), and works wonderfully in my GF's computer.

dsp.get_display_name() outputs the same as echo $DISPLAY. 

It seems that PyWO fails to get the properties of the window.

:~$ pywo debug

Xlib.protocol.request.QueryExtension
Traceback (most recent call last):
  File "/usr/local/bin/pywo", line 9, in <module>
    load_entry_point('PyWO==0.3.0', 'console_scripts', 'pywo')()
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 305, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2244, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1954, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/local/lib/python2.6/dist-packages/PyWO-0.3.0-py2.6.egg/pywo/main.py", line 29, in <module>
    from pywo import actions, commandline
  File "/usr/local/lib/python2.6/dist-packages/PyWO-0.3.0-py2.6.egg/pywo/actions/__init__.py", line 34, in <module>
    from pywo.actions.core import TYPE_FILTER, STATE_FILTER, TYPE_STATE_FILTER
  File "/usr/local/lib/python2.6/dist-packages/PyWO-0.3.0-py2.6.egg/pywo/actions/core.py", line 35, in <module>
    WM = WindowManager()
  File "/usr/local/lib/python2.6/dist-packages/PyWO-0.3.0-py2.6.egg/pywo/core/windows.py", line 651, in __new__
    manager.update_type()
  File "/usr/local/lib/python2.6/dist-packages/PyWO-0.3.0-py2.6.egg/pywo/core/windows.py", line 690, in update_type
    name = self.name.lower()
  File "/usr/local/lib/python2.6/dist-packages/PyWO-0.3.0-py2.6.egg/pywo/core/windows.py", line 670, in name
    name = win.get_property('_NET_WM_NAME')
  File "/usr/local/lib/python2.6/dist-packages/PyWO-0.3.0-py2.6.egg/pywo/core/xlib.py", line 119, in get_property
    property = self._win.get_full_property(atom, 0)
  File "/usr/lib/pymodules/python2.6/Xlib/xobject/drawable.py", line 459, in get_full_property
    prop = self.get_property(property, type, 0, sizehint)
  File "/usr/lib/pymodules/python2.6/Xlib/xobject/drawable.py", line 448, in get_property
    long_length = length)
  File "/usr/lib/pymodules/python2.6/Xlib/protocol/rq.py", line 1428, in __init__
    self.reply()
  File "/usr/lib/pymodules/python2.6/Xlib/protocol/rq.py", line 1448, in reply
    raise self._error
Xlib.error.BadWindow: <class 'Xlib.error.BadWindow'>: code = 3, resource_id = 
Xlib.xobject.resource.Resource(0x0180007a), sequence_number = 33, major_opcode 
= 20, minor_opcode = 0

I hope I get this problem sorted because I find PyWO functionality extremely 
useful (I wonder why no distro include it by default!)

thanks

Original comment by flavioza...@gmail.com on 23 Jul 2011 at 9:07

GoogleCodeExporter commented 8 years ago
64 bit Kubuntu - I need to check it. In Virtualbox I've tried 32bit versions 
only.

Original comment by kosci...@gmail.com on 25 Jul 2011 at 9:28