[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#799983: unison-gtk: profile shortcut keys not working since 2.40



Package: unison-gtk
Version: 2.40.102-2
Severity: normal
Tags: patch

Hi,

shortcut keys defined in profiles for the GTK UI ceased working since 2.40
(Jessie). Until 2.32.x it was working fine.

Finally I found some time to dig into this and found, that now the profiles are
scanned only after the main window is created. So the shortcut keys defined
therein are just unknown to the code creating the main window.

The attached patch fixes this for 2.40 and upwards: it simply moves the call to
scanProfiles() so it gets executed prior to createToplevelWindow().

However there's a little catch: only moving scanProfiles() isn't enough. If
~/.unison doesn't exist yet, unison exits with

-----------8<-------------
../unison
UISTYLE = gtk2
Building for Unix
NATIVE = true
THREADS = false
STATIC = false
OSTYPE =
OSARCH =
Error in listing files:
No such file or directory [opendir(/home/dhrdev/.unison)]
Fatal error: exception Assert_failure("/home/dhrdev/tmp/unison/uigtk2.ml", 143, 14)
-----------8<-------------

So I prepended scanProfiles() with Os.createUnisonDir() and then it runs
smoothly. This might not be the cleanest way of solving this hen-or-egg kind of
problem. I'm looking forward to your suggestions!

I also filed a bug report with upstream. [1]


Let me know if you need more information.


Thanks,
Daniel


[1] https://groups.yahoo.com/neo/groups/unison-users/conversations/messages/11720



-- System Information:
Debian Release: 8.2
  APT prefers stable
  APT policy: (990, 'stable'), (600, 'testing'), (500, 'testing-proposed-updates'), (500, 'stable-updates'), (500, 'proposed-updates'), (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: sysvinit (via /sbin/init)

Versions of packages unison-gtk depends on:
ii  libatk1.0-0          2.14.0-1
ii  libc6                2.19-18+deb8u1
ii  libcairo2            1.14.0-2.1
ii  libfontconfig1       2.11.0-6.3
ii  libfreetype6         2.5.2-3
ii  libgdk-pixbuf2.0-0   2.31.1-2+deb8u2
ii  libglib2.0-0         2.42.1-1
ii  libgtk2.0-0          2.24.25-3
ii  libpango-1.0-0       1.36.8-3
ii  libpangocairo-1.0-0  1.36.8-3
ii  libpangoft2-1.0-0    1.36.8-3

Versions of packages unison-gtk recommends:
ii  openssh-client [ssh-client]  1:6.7p1-5
ii  ssh-askpass                  1:1.2.4.1-9

Versions of packages unison-gtk suggests:
pn  unison-all-gtk  <none>

-- no debconf information
--- a/unison-2.40.102/uigtk2.ml	2010-04-15 19:29:31.000000000 +0200
+++ b/unison-2.40.102/uigtk2.ml	2015-09-25 04:41:34.647109129 +0200
@@ -4250,6 +4250,8 @@
     in
     ignore_result (tick ());
 
+    Os.createUnisonDir();
+    scanProfiles();
     let detectCmd = createToplevelWindow() in
 
     Uicommon.uiInit
@@ -4260,7 +4262,6 @@
       getFirstRoot
       getSecondRoot
       termInteract;
-    scanProfiles();
     detectCmd ();
 
     (* Display the ui *)

Reply to: