Onboard crashes completely on start.

Bug #1633284 reported by John
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Onboard
Fix Committed
High
Unassigned

Bug Description

I'm running onboard 1.3.0-1. This is a new bug I was not getting until today, upon starting onboard crashes with:

(onboard:9702): Gtk-CRITICAL **: gtk_window_set_default_size: assertion 'width >= -1' failed

(onboard:9702): Gtk-CRITICAL **: gtk_window_set_default_size: assertion 'width >= -1' failed
Traceback (most recent call last):
  File "/usr/sbin/onboard", line 36, in <module>
    ob = Onboard()
  File "/usr/lib/python3.5/site-packages/Onboard/OnboardGtk.py", line 147, in __init__
    self.init()
  File "/usr/lib/python3.5/site-packages/Onboard/OnboardGtk.py", line 188, in init
    self._init_delayed()
  File "/usr/lib/python3.5/site-packages/Onboard/OnboardGtk.py", line 265, in _init_delayed
    self.keyboard_widget.set_startup_visibility()
  File "/usr/lib/python3.5/site-packages/Onboard/KeyboardWidget.py", line 434, in set_startup_visibility
    self.commit_transition()
  File "/usr/lib/python3.5/site-packages/Onboard/KeyboardWidget.py", line 713, in commit_transition
    self._on_transition_step()
  File "/usr/lib/python3.5/site-packages/Onboard/KeyboardWidget.py", line 749, in _on_transition_step
    window.set_visible(visible)
  File "/usr/lib/python3.5/site-packages/Onboard/KbdWindow.py", line 393, in set_visible
    self.on_visibility_changed(visible)
  File "/usr/lib/python3.5/site-packages/Onboard/KbdWindow.py", line 685, in on_visibility_changed
    self.move_resize(*rect) # sync position
  File "/usr/lib/python3.5/site-packages/Onboard/KbdWindow.py", line 223, in move_resize
    self.pre_render_keys(w, h)
  File "/usr/lib/python3.5/site-packages/Onboard/KbdWindow.py", line 227, in pre_render_keys
    self.keyboard_widget.pre_render_keys(self, w, h)
  File "/usr/lib/python3.5/site-packages/Onboard/KeyboardWidget.py", line 452, in pre_render_keys
    self.render(context)
  File "/usr/lib/python3.5/site-packages/Onboard/LayoutView.py", line 256, in render
    item.draw_cached(context)
  File "/usr/lib/python3.5/site-packages/Onboard/KeyGtk.py", line 162, in draw_cached
    entry = self._create_key_surface(cr)
  File "/usr/lib/python3.5/site-packages/Onboard/KeyGtk.py", line 177, in _create_key_surface
    clip_rect.w, clip_rect.h)
SystemError: <built-in method create_similar of cairo.XlibSurface object at 0x7fdfdb62fbd0> returned NULL without setting an error

Related branches

Revision history for this message
Francesco Fumanti (frafu) wrote :

Hi John,

Thanks for your interest in Onboard and for your support.

Could you please provide more pieces of information. For example, the distribution you are running, the circumstances of the crash, the changes performed to your system (Onboard update, python update,...) that created this new problem on your system,...

Thanks in advance.

Revision history for this message
marmuta (marmuta) wrote :

Could be a negative width or height of the window for some reason. Could you post the output of
gsettings list-recursively org.onboard | grep -v snippets
?

Afterwards, as a workaround, maybe try to correct the window size in gsettings:
gsettings reset org.onboard.window.landscape width
gsettings reset org.onboard.window.landscape height

Does that change anything?

Revision history for this message
John (johnramsden) wrote :
Download full text (3.3 KiB)

When I checked it was set to:

org.onboard.window.portrait dock-width 600
org.onboard.window.portrait width 600
org.onboard.window.portrait dock-expand true
org.onboard.window.portrait y 50
org.onboard.window.portrait dock-height 200
org.onboard.window.portrait height 200
org.onboard.window.portrait x 100
org.onboard.window.landscape dock-width 700
org.onboard.window.landscape width -40
org.onboard.window.landscape dock-expand true
org.onboard.window.landscape y -3
org.onboard.window.landscape dock-height 205
org.onboard.window.landscape height -20
org.onboard.window.landscape x 1278

After resetting it went to:

org.onboard.window.portrait dock-width 600
org.onboard.window.portrait width 600
org.onboard.window.portrait dock-expand true
org.onboard.window.portrait y 50
org.onboard.window.portrait dock-height 200
org.onboard.window.portrait height 200
org.onboard.window.portrait x 100
org.onboard.window.landscape dock-width 700
org.onboard.window.landscape width 700
org.onboard.window.landscape dock-expand true
org.onboard.window.landscape y -3
org.onboard.window.landscape dock-height 205
org.onboard.window.landscape height 205
org.onboard.window.landscape x 1278

Problem is as soon as I open it it just sets itself back to the original numbers but nothing opens.

I get

(onboard:32091): Gtk-CRITICAL **: gtk_window_set_default_size: assertion 'width >= -1' failed
Traceback (most recent call last):
  File "/usr/sbin/onboard", line 36, in <module>
    ob = Onboard()
  File "/usr/lib/python3.5/site-packages/Onboard/OnboardGtk.py", line 147, in __init__
    self.init()
  File "/usr/lib/python3.5/site-packages/Onboard/OnboardGtk.py", line 188, in init
    self._init_delayed()
  File "/usr/lib/python3.5/site-packages/Onboard/OnboardGtk.py", line 265, in _init_delayed
    self.keyboard_widget.set_startup_visibility()
  File "/usr/lib/python3.5/site-packages/Onboard/KeyboardWidget.py", line 434, in set_startup_visibility
    self.commit_transition()
  File "/usr/lib/python3.5/site-packages/Onboard/KeyboardWidget.py", line 713, in commit_transition
    self._on_transition_step()
  File "/usr/lib/python3.5/site-packages/Onboard/KeyboardWidget.py", line 749, in _on_transition_step
    window.set_visible(visible)
  File "/usr/lib/python3.5/site-packages/Onboard/KbdWindow.py", line 393, in set_visible
    self.on_visibility_changed(visible)
  File "/usr/lib/python3.5/site-packages/Onboard/KbdWindow.py", line 685, in on_visibility_changed
    self.move_resize(*rect) # sync position
  File "/usr/lib/python3.5/site-packages/Onboard/KbdWindow.py", line 223, in move_resize
    self.pre_render_keys(w, h)
  File "/usr/lib/python3.5/site-packages/Onboard/KbdWindow.py", line 227, in pre_render_keys
    self.keyboard_widget.pre_render_keys(self, w, h)
  File "/usr/lib/python3.5/site-packages/Onboard/KeyboardWidget.py", line 452, in pre_render_keys
    self.render(context)
  File "/usr/lib/python3.5/site-packages/Onboard/LayoutView.py", line 256, in render
    item.draw_cached(context)
  File "/usr/lib/python3.5/site-packages/Onboard/KeyGtk.py", line 162, in draw_cached
    entry = self._create_key_surface(cr)
  File "/usr/lib/python3.5/site-packages/Onboard/KeyGtk.py...

Read more...

Revision history for this message
John (johnramsden) wrote :

Oh, and i'm running arch linux in openbox,

It may have been the recent update on 2016-10-06:
https://git.archlinux.org/svntogit/community.git/log/trunk?h=packages/onboard

I tried downgrading but it didn't help though.

Revision history for this message
marmuta (marmuta) wrote :

org.onboard.window.landscape width -40
org.onboard.window.landscape height -20

Yeah, not good.

org.onboard.window.landscape y -3
org.onboard.window.landscape x 1278
Depending on your screen size this could mean the keyboard is outside of the screen. Perhaps there's a problem with the code that limits the keyboard's dimensions. What's your screen resolution? One or multiple monitors?

Could you try
gsettings reset org.onboard.window.landscape x
gsettings reset org.onboard.window.landscape y
gsettings reset org.onboard.window.landscape width
gsettings reset org.onboard.window.landscape height
?

Revision history for this message
John (johnramsden) wrote :

I'm using a 4k tv with resolution 3840x2160.

I tried the gsettings, no luck, same error.

Revision history for this message
marmuta (marmuta) wrote :

Would you be willing to attach your custom layout john.onboard here? I've replicated all other settings here but couldn't reproduce the problem. Alternatively, does switching to e.g. Compact layout +

gsettings reset org.onboard.window.landscape x
gsettings reset org.onboard.window.landscape y
gsettings reset org.onboard.window.landscape width
gsettings reset org.onboard.window.landscape height

change anything.

Please do this while Onboard isn't running and verify the settings have been correctly reset:
gsettings get org.onboard.window.landscape x
100
gsettings get org.onboard.window.landscape y
50
gsettings get org.onboard.window.landscape width
700
gsettings get org.onboard.window.landscape height
205

Thanks for your patience.

Revision history for this message
marmuta (marmuta) wrote :

FWIW, I tested in openbox on Ubuntu and couldn't reproduce it there either.

The recent update of
https://git.archlinux.org/svntogit/community.git/log/trunk?h=packages/onboard
doesn't seem to do anything suspicious. The patch of lm_dynamic_cached.h should't be necessary anymore for Onboard 1.3. AppIndicator is optional, so removing the dependncy is fine. Otherwise it's plain Onboard 1.3.

Revision history for this message
John (johnramsden) wrote :

Well, right now I cannot open onboard to choose a different layout. I did try the gsettings though and had no luck.

I have tried deleting my layout completely though, and that doesn't help. I did attach it though in case there's something helpful there.

I do think you might be right about the resolution of my screen causing it however, I have an alternate install of Arch Linux on the same computer where the same problem occurs. I am running the exact same setup in openbox on Arch. The reason I think it might be a resolution related is I also have the exact same setup on two laptops and on both of them onboard works fine. Later today I will try to track down a smaller monitor to see if I can get it to work there.

Revision history for this message
marmuta (marmuta) wrote :

I should have mentioned that you can switch the layout without having Onboard running. The preferences dialog is a separate little program:
$ onboard-settings

I've been trying to come up with scenarios where the high resolution would cause overflows or something, but got nothing so far. It's still possible this is one contributing factor. On the other hand, it started suddenly, and I suppose you didn't change monitors when it happened. Also, while I don't have access to a 4k monitor, I did test similar high resolution (in x at least) setups with multiple monitors.

It'd be good if you could verify that the values read back are the ones you put in, e.g.

gsettings reset org.onboard.window.landscape width
or
gsettings set org.onboard.window.landscape width 123
then
gsettings get org.onboard.window.landscape width

Just like that, without running Onboard.

I tested the layout together with the svg files of Full Keyboard, but no change, nothing unexpected happened.

Btw. there is a hidden setting to turn on secondary labels:
gsettings set org.onboard.keyboard show-secondary-labels true

This only works with some layouts (that's why it's hidden), it does with Full Keyboard, though.

I may need to pepper onboard with more debug output and let you install it from source. I see no better option, currently.

Changed in onboard:
importance: Undecided → High
Revision history for this message
John (johnramsden) wrote :

So I did a test using a normal size monitor, and the problem still occurred. I also tested using a default xorg config, no change...

I also did notice that I can open the settings and change the settings around, but that doesn't change anything.

When I attempt to change the settings and then check them they do seem to be setting properly and returning me the proper values.

That's good to know about the secondary labels, I guess it didn't make sense for me to spend an hour figuring out how to make a new layout :)

By the way, I'm a huge fan of the project. I was using xvkbd before and this is a huge step up from that. I was actually considering writing my own keyboard when I found onboard.

Revision history for this message
marmuta (marmuta) wrote :

Thanks for the additional testing. I was about to ask for the reported physical size of the monitor (xrandr), but since you tested a different one, that possible failure mode has become less likely. Sorry for the delay, I'm working on adding debug output right now.

Thanks, hey we have a fan! I'm always happy to hear people like to use Onboard.

Revision history for this message
marmuta (marmuta) wrote :

I believe I have a fix. The cause is apparently Gtk reporting a screen size of (0, 0). Onboard couldn't handle that before. I've added plausibility checks at two locations and some additional debug output.

If you can, please try installing the latest revision from source and see if the problem is gone. There's are some instructions for Arch in the README at

https://bazaar.launchpad.net/~onboard/onboard/trunk/view/head:/README#L98

but they might be a bit outdated by now. If you get stuck, let me know.

If you managed to build it and the problem hasn't disappeared, please run
onboard -ddebug &>onboard-debug.txt
and attach the file here.

Changed in onboard:
status: New → Fix Committed
Revision history for this message
John (johnramsden) wrote :

Well I tried the build. It compiled fine but I got the error:

17:15:40.330 ERROR Config: gsettings schema for 'org.onboard.keyboard' is not installed

I was able to get it to run by removing the old schema and adding the one in onboard/data/.

sudo rm /usr/share/glib-2.0/schemas/org.onboard.gschema.xml
sudo cp org.onboard.gschema.xml /usr/share/glib-2.0/schemas/
sudo glib-compile-schemas /usr/share/glib-2.0/schemas/

At that point I got this error:

Traceback (most recent call last):
  File "/sbin/onboard", line 36, in <module>
    ob = Onboard()
  File "/usr/lib/python3.5/site-packages/Onboard/OnboardGtk.py", line 147, in __init__
    self.init()
  File "/usr/lib/python3.5/site-packages/Onboard/OnboardGtk.py", line 188, in init
    self._init_delayed()
  File "/usr/lib/python3.5/site-packages/Onboard/OnboardGtk.py", line 272, in _init_delayed
    self.keyboard_widget.set_startup_visibility()
  File "/usr/lib/python3.5/site-packages/Onboard/KeyboardWidget.py", line 433, in set_startup_visibility
    self.commit_transition()
  File "/usr/lib/python3.5/site-packages/Onboard/KeyboardWidget.py", line 712, in commit_transition
    self._on_transition_step()
  File "/usr/lib/python3.5/site-packages/Onboard/KeyboardWidget.py", line 748, in _on_transition_step
    window.set_visible(visible)
  File "/usr/lib/python3.5/site-packages/Onboard/KbdWindow.py", line 399, in set_visible
    self.on_visibility_changed(visible)
  File "/usr/lib/python3.5/site-packages/Onboard/KbdWindow.py", line 691, in on_visibility_changed
    self.move_resize(*rect) # sync position
  File "/usr/lib/python3.5/site-packages/Onboard/KbdWindow.py", line 214, in move_resize
    self.pre_render_keys(w, h)
  File "/usr/lib/python3.5/site-packages/Onboard/KbdWindow.py", line 218, in pre_render_keys
    self.keyboard_widget.pre_render_keys(self, w, h)
  File "/usr/lib/python3.5/site-packages/Onboard/KeyboardWidget.py", line 451, in pre_render_keys
    self.render(context)
  File "/usr/lib/python3.5/site-packages/Onboard/LayoutView.py", line 256, in render
    item.draw_cached(context)
  File "/usr/lib/python3.5/site-packages/Onboard/KeyGtk.py", line 162, in draw_cached
    entry = self._create_key_surface(cr)
  File "/usr/lib/python3.5/site-packages/Onboard/KeyGtk.py", line 177, in _create_key_surface
    clip_rect.w, clip_rect.h)
SystemError: <built-in method create_similar of cairo.XlibSurface object at 0x7f111809d990> returned NULL without setting an error

Hopefully the debug helps.

How do I uninstall it after installing from source by the way?

marmuta (marmuta)
Changed in onboard:
status: Fix Committed → New
Revision history for this message
marmuta (marmuta) wrote :

Thanks for testing. At least you got a different traceback now. That's progress, I guess. I'm going to install Arch now.

I'll add the schema compile step to the README. We have a tiny script for that, tools/install_gsettings_schema. It does what you did, but is easier to remember.

It'll install in the /usr/local prefix by default. There's no built-in uninstall in setup.py, but there's a workaround by installing again:
sudo ./setup.py install --record files.txt
cat files.txt | sudo xargs rm -rf

I should have made it clear that you don't even have to install for testing. Installing the schema and ./onboard from the project directory would have been enough until we know it works.

Revision history for this message
marmuta (marmuta) wrote :

I just finished testing with a minimal Arch setup with lightdm, openbox and Intel video.
There were some minor annoyances, see
http://bazaar.launchpad.net/~onboard/onboard/trunk/revision/2190
http://bazaar.launchpad.net/~onboard/onboard/trunk/revision/2191
but no hint of this bug. Tested with both the onboard package and built from latest source.

I'll take another look at your latest traceback then.

Revision history for this message
marmuta (marmuta) wrote :

OK, I have another revision. Please update the source and rebuild.

cd onboard
bzr pull
./setup.py build

Does it run this time?
./onboard

Revision history for this message
John (johnramsden) wrote :

We have a winner!

It works! i'm getting Gdk warnings but it works!

./onboard
18:48:17.926 WARNING Config: Starting in project directory, importing local packages and extensions.

(onboard:17511): Gdk-CRITICAL **: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed

What did you change?

Revision history for this message
marmuta (marmuta) wrote :

At first
https://bazaar.launchpad.net/~onboard/onboard/trunk/revision/2188
then
https://bazaar.launchpad.net/~onboard/onboard/trunk/revision/2192

sz, sz_mm = get_monitor_dimensions(window)
returns (0,0) for sz on your system.

From the debug log:
17:30:42.223 DEBUG KbdWindow _cb_realize_event, screen size 0x0
17:30:42.223 DEBUG KbdWindow _cb_realize_event, monitor dimensions: (0, 0) pixel, (508, 286) mm
17:30:42.223 DEBUG KbdWindow _cb_realize_event, get_min_window_size(): 0 0

Why? I don't know. Only that it must be really rare. Yours is the first case I heard from.

One remaining effect is that the size of label popups might be a bit off. They have a 120 pixel fall-back. If you use them at all, you can override this with
gsettings set org.onboard.keyboard touch-feedback-size 100
for example (in pixel, 0=auto). I should probably add a slider to preferences.

Oh, and I have a slightly better uninstall:
sudo ./setup.py install --record files.txt
sudo xargs --delimiter='\n' -a files.txt rm -v
sudo rm -rf /usr/local/share/onboard

The previous one still left stuff behind that could cause startup failures.

The remaining warnings are "normal". Onboard doesn't actively freeze any windows.

Thanks for your patience again, it's always a pleasure to work with Arch people.

Changed in onboard:
status: New → Fix Committed
Revision history for this message
John (johnramsden) wrote :

So this will be in the next release?

Revision history for this message
marmuta (marmuta) wrote :

Yes, the next one. 1.4 or less likely 1.3.x, whichever comes first.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.