Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

box_cursor leaves ghost frames on screen #1797

Closed
brandy125 opened this issue Apr 3, 2024 · 13 comments
Closed

box_cursor leaves ghost frames on screen #1797

brandy125 opened this issue Apr 3, 2024 · 13 comments

Comments

@brandy125
Copy link

The box_cursor procedure leaves ghost frames on the screen while moving the mouse with a buttom pressed or while resizing the box.

GDL> window,xsize=500,ysize=500
GDL> box_cursor,100,100,100,100,/init

Screenshot_2024-04-03 15 54 09_lxr4Bo

Anybody can confirm if this is on other OSs as well?

@GillesDuvert
Copy link
Contributor

Yes this is due to the use of CAIRO by GTK, and wxWidgets uses GTK on linux. CAIRO is probably very modern and all that but does not, and will not, include XOR or INVERT graphic writing modes. See #1288.
On OSX and Windows, no GTK, no CAIRO, no problem.
Using X11 (gdl -X ) makes box_cursor work on linux, but on graphic windows only, not in WIDGET_DRAW.
Yes this is nightmarish.

@brandy125
Copy link
Author

Thank you for that hint with gdl -X
Is there a way to use X11 temporarily inside a running GDL session (just for that box_cursor stuff)?

@GillesDuvert
Copy link
Contributor

Ah, excellent question! At some point, (gdl 0.9.9 ?) this was possible, but to simplify maintainance of GDL, its now either X11 or wxWidgets.
But, I found that replacing "6" (XOR) by "10" (Invert) in box_cursor.pro produced good results, especially on a black background. This could help you.

@GillesDuvert
Copy link
Contributor

incidentally, I've patched GDL to use Invert when XOR (6) is used in procedures like box_cursors. helps a little.

@brandy125
Copy link
Author

@GillesDuvert thanks for that but I noticed that at least on my setup the command

GDL>device,set_graphics_function=10

has no effect. Actually no value makes any difference while after starting GDL with -X it does:

bash$ gdl -X

GDL> px=[219,281,281,219,219]
GDL> py=[219,281,281,319,219]
GDL> window,xsize=500,ysize=500,xpos=100,ypos=500 & erase,20
GDL> plots,px,py,col=255,/dev
GDL> device, set_graphics = 6
GDL> plots,px,py,col=255,/dev
GDL> plots,px,py,col=255,/dev
GDL> plots,px,py,col=255,/dev
GDL> 

so after setting set_graphics_function to 6 it nicely makes the triangle disappearing and appearing.

When starting gdl without "-X" the triangle does not disappear even setting set_graphics_function to any value between 0 and 15.

Maybe only a problem with my setup?

@GillesDuvert
Copy link
Contributor

I have changed the actual operation for '6' only for the wxWidgets 'flavour' of the window. Nothing for X has changed, as I believed the old X11 code to be OK. This to avoid changing the code in box_cursor, that should work "as is" and not with my proposed ugly patch.

I took for granted that the device, set_graphics=XX historical command for X11 windows produced excellent results, but as there are no test in our testsuite checking that, regression has occured. (OTOH, such a test will not pass with the default windows, that are wxWidgets.) Your test show that even the X11 flavor do not obey to the set_graphics_function command.

@brandy125
Copy link
Author

Maybe I was not clear in my post. With X11 it is working nicely.
When working with wxWidgets the set_graphics=XX has no effect.

@GillesDuvert
Copy link
Contributor

Do you mean that either

  1. you have compiled GDL with the 86bd191 patch, and use a pristine box_cursor,
    or 2) you have just replaced '6' by '10' in the box_cursor.pro code,
    and found that box_cursor is still making clearly visible ghosts?

@brandy125
Copy link
Author

brandy125 commented Apr 6, 2024 via email

@GillesDuvert
Copy link
Contributor

Hm strange, here with the latest patch and the untouched box_cursor.pro I have decent results whatever the background color. Are you on linux?

@brandy125
Copy link
Author

brandy125 commented Apr 6, 2024 via email

@GillesDuvert
Copy link
Contributor

Hm, this may depend from the version of either [cairo, gtk] (indirectly) or [wxWidgets] (directly) used by the plplot driver (easy is'nt it?). Here I have the plplot drivers depend on libwx_gtk3u_core-3.1.so.7.
That said, I gave a look at the GDL code and wonder if there is not an added complication due to the double buffering used by wxWidgets and supposed to be faster.

@GillesDuvert
Copy link
Contributor

#1802 may be the solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants