annotate plugin draw interface not working (e.g. dbus method call)

Bug #1878545 reported by Daniel Kondor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Compiz
Fix Released
Undecided
Unassigned

Bug Description

Hi,

this is a problem that I've had for some time, but finally had some time to look into this.

Basically, the draw method exposed by the annotate plugin on DBus is not working. My use case is easystroke (https://github.com/markdstjohn/easystroke), but see below a minimal example to reproduce this.

How to reproduce:

1. Enable annotate and dbus plugins.
2. Make sure annotate is working normally with the keybinding associated.
3. Form a terminal run:
dbus-send --print-reply --type=method_call --dest=org.freedesktop.compiz /org/freedesktop/compiz/annotate/screen0/draw org.freedesktop.compiz.activate string:tool

Expected behavior:
A line is drawn in the top left corner in the screen.

Actual behavior:
Nothing happens.

(Note: optional parameters x1,x2,y1,y2 could be used to specify the coordinates to draw to, but these are not necessary for this example -- it should work without giving any coordinates as well.)

Cause of bug (in plugins/annotate/src/annotate.cpp):
 -- "tool" variable in AnnoScreen::draw() gets overwritten between lines 305 and 322 (is it undefined behavior to save the c_str() of the value returned by CompOption::getStringOptionNamed()?)
 -- AnnoScreen::draw() needs to call handleEventSetEnabled() and glPaintOutputSetEnabled() to actually draw anything on the screen

I'm attaching a diff (for plugins/annotate/src/annotate.cpp) that fixes the issue for me.

Note: I've tried this on compiz 0.9.13 on Ubuntu 18.04 and I did not try on 0.9.14. Nevertheless, annotate.cpp is the same for 0.9.13 and 0.9.14, so I'd be surprised if there was a difference.

Related branches

Revision history for this message
Daniel Kondor (kondor-dani) wrote :
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Can you please submit a merge proposal against lp:compiz git branch?

Revision history for this message
Daniel Kondor (kondor-dani) wrote :

Sure, just created a merge proposal. Thanks for the quick reply :)

Changed in compiz:
status: New → Fix Committed
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

I have released version 0.9.14.2 today, which includes this fix.

Changed in compiz:
status: Fix Committed → Fix Released
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.