Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / customdrawn / 2012-04

A few patches

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Giuliano Colla

Attached a few patches.
1) With an ifdef SMART_PAINT, sends the buffered image to X without repainting, on MOVE or EXPOSE events, taking into account both resizes, and image invalidated.

2) Fixed Color Depth and DPI from X server.

3) An attempt to get Image format from X. Better give a look to see if I've interpreted properly image format received, and values to set. One should raise an exception if the available format is not supported, but I was unsure of what's fully supported and what just appears to be.

4) Fixed the position of Types for Cocoa, and for the rest of the world.

5) Beginning of TrayIcon. For the moment I've just created a missing object, and removed XGrabServer, which is both not necessary and very dangerous, because it locks screen, mouse and keyboard. It should be used only by the Window Manager to lock the screen. Besides it makes impossible to step through the program, because when you get there, you can't step anymore! Removed also XFlush, which may flush events not yet processed, and it would not be pleasant.

I don't believe I'll be able to do much more for some days, and as it's appears that in this moment (as of rev. 36717) the patches do not raise any conflict, I thought it was to good time to send the patches.

Giuliano

-------------- next part --------------
A non-text attachment was scrubbed...
Name: HEAD.diff
Type: text/x-patch
Size: 12001 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/customdrawn/attachments/20120411/cebd6084/attachment.bin>

Felipe Monteiro de Carvalho
to Giuliano Colla

Thanks, applied in rev 36721 with very small modifications

I completely removed the Grab stuff because it is really nasty. I had to kill my X server multiple times because it would make the magnifier freeze the entire desktop =( Better not risk anyone uncommenting it in the future.

3) An attempt to get Image format from X. Better give a look to see if I've interpreted properly image format received, and values to set. One should raise an exception if the available format is not supported, but I was unsure of what's fully supported and what just appears to be.

You did it well =)

Note that if we ever run into yet more format possibilities we can always expand the enum and the routine UpdateControlLazImageAndCanvas

Note also that I don't think that an exception is adequate here. ScreenFormat is not a hard description of the screen format. It is a hint. It will tell controls to use this format so that in CanvasCopy operations will be faster when both canvas use the same image format. If the format does not match it is not problem! It will only be slower.

Felipe Monteiro de Carvalho