Xpra: Ticket #1606: Two 'referenced before assignment' bugs in main.py

Thanks for working on the software, it's really useful.

First:

2017-07-29 13:46:20,160 error preparing connection: local variable 'xdpi' referenced before assignment
Traceback (most recent call last):
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/client/client_base.py", line 317, in send_hello
    hello.update(self.make_hello())
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/client/gtk2/client.py", line 287, in make_hello
    capabilities = GTKXpraClient.make_hello(self)
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/client/gtk_base/gtk_client_base.py", line 418, in make_hello
    capabilities = UIXpraClient.make_hello(self)
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/client/ui_client_base.py", line 1424, in make_hello
    self._last_screen_settings = (root_w, root_h, sss, ndesktops, desktop_names, u_root_w, u_root_h, xdpi, ydpi)
UnboundLocalError: local variable 'xdpi' referenced before assignment

Second:

2017-07-29 13:48:03.573 Xpra[2551:63940] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
xpra main error:
Traceback (most recent call last):
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/main.py", line 176, in main
    return run_mode(script_file, err, options, args, mode, defaults)
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/main.py", line 1324, in run_mode
    return run_remote_server(error_cb, options, args, mode, defaults)
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/main.py", line 2468, in run_remote_server
    app.start_new_session = sns
UnboundLocalError: local variable 'sns' referenced before assignment


Sat, 29 Jul 2017 13:16:33 GMT - Antoine Martin: owner changed

The first one (xdpi) is resolved here: #1605

For the second one, please include the exact command line that you've used so that I can make sure the fix is correct.


Sat, 29 Jul 2017 13:29:26 GMT - Ray Donnelly:

/Applications/Xpra.app/Contents/MacOS/Xpra start ssh/ME@IP_ADDRESS/100 --dpi=96 --swap-keys=no --start-child=gnome-terminal

Sat, 29 Jul 2017 14:47:54 GMT - Antoine Martin:

Thank you very much! Found lots of little problems.

The following fixes will be included in the next stable update:

All these fixes are available in the latest 2.2 beta build for macos which you can find here: http://xpra.org/beta/osx. Please close if that works for you.


Sat, 29 Jul 2017 15:14:24 GMT - Ray Donnelly:

Wow, thanks for being so responsive! I will check it later.

My main goal here is to see what's up with the command button ending up with the same keycode on the remote (linux side) and the alt button.

state 0x18, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,

I *think* I need it to be Super_L instead. I know keyboard handling is a difficult topic; wish me luck. I read this bug report and it seems somewhat related: https://bugzilla.gnome.org/show_bug.cgi?id=736125 but if you have any better pointers I'd appreciated it (I know about -d keyboard).

Also, I found setting up the build env to be very difficult and gave up (I'm pretty experienced at this kind of thing, working on 2 software distros). In the end, I'm using your releases but copying the .py files beside the .pyc ones so I can test my changes! I wonder if doing this for official releases might lower the barrier to entry a little?

Thanks again. I'll give more feedback later.


Sat, 29 Jul 2017 15:18:04 GMT - Antoine Martin:

Please use a different ticket for keyboard issues. (sound like we may want to manually backport this patch to GTK2 for macos)


Sat, 29 Jul 2017 21:53:33 GMT - Ray Donnelly: status changed; resolution set

This is now fixed, many thanks.


Sat, 23 Jan 2021 05:28:57 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1606