Menu

#271 TableDisplay() is broken by default in X11

closed-fixed
tktable (65)
6
2020-11-27
2007-09-30
Anonymous
No

text gets rendered and overlaps other cells.

The fix is to #define NO_XSETCLIP 1

It seems from the ChangeLog you're already using it for the Mac, and now for Windows (due to thread problems), so you might as well just use the single path #ifdef NO_XSETCLIP.

The clip region being set is wrong in most cases in X11 otherwise, and the text flickers a bit.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    This workaround is not really a solution because it is slower than using XSetClipRectangles (it involves copying pixmaps around twice in the X server) and does not appear to work if the rectangle is partially obscured (for instance if another window partially overlaps the cell being displayed)--in this case, the text does not appear in the cell at all.

     
  • Mario Becroft

    Mario Becroft - 2007-10-01

    Logged In: YES
    user_id=1903261
    Originator: NO

    Perhaps someone in the know could point out what has changed in Tk8.5b1 relative to 8.5a4 (the last version I know did not have the problem) which has changed the clipping? To me the clipping code in TkTable looks very straight-forward. Unless something within Tk_DrawTextLayout fiddles with the clip-mask, it is unclear why it would be going wrong. But I don't know anything about Tk so maybe I am missing something obvious. Help please?

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2007-10-02

    Logged In: YES
    user_id=72656
    Originator: NO

    Can you please specify the exact specifics of the core you compiled? Does this happen on the latest 8.4 as well, or just 8.5b1?

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2007-10-02
    • priority: 5 --> 6
     
  • Mario Becroft

    Mario Becroft - 2007-10-03

    Logged In: YES
    user_id=1903261
    Originator: NO

    The only ones I tried were 8.5a4 and 8.5b1. On 8.5a4 it works ok, but on 8.5b1 the problem happens. I heard from someone else that they had the same problem on 8.5a6, but I can't verify that myself. I don't think I have the latest Tktable from CVS though, so perhaps I should check this. I will attempt to check this in about 1 day and report.

    Apart from making the text overlap, in some cases (unclear when exactly) it also makes the cells not get drawn at all sometimes. Presumably because in those cases it is being clipped, but clipped to some area completely outside the bounds of the text!

     
  • Mario Becroft

    Mario Becroft - 2007-10-03

    Logged In: YES
    user_id=1903261
    Originator: NO

    Verified that the problem still happens with the latest CVS from a couple of hours ago.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2007-10-03

    Logged In: YES
    user_id=72656
    Originator: NO

    Sorry, but this is not helpful in determining the problem. How was 8.5 compiled? Does it use Xft? What if you disable Xft? Threads?

     
  • Mario Becroft

    Mario Becroft - 2007-10-03

    Logged In: YES
    user_id=1903261
    Originator: NO

    It was compiled by typing "./configure" then "make" which I presume means all the options are standard, since I have not specified any. According to the configure output it is using Xft, although I did not enable this feature. I am not exactly sure what it does--I thought it was something to do with using client-side fonts, but the fonts look the same as usual so I can't tell whether this is what it is doing. Perhaps I should try without Xft? I will try configuring with --disable-xft and see if it makes a difference. I don't know what other specific information you need in order to diagnose the problem. If you tell me what to do, I will provide any further information required.

     
  • Mario Becroft

    Mario Becroft - 2007-10-03

    Logged In: YES
    user_id=1903261
    Originator: NO

    Yay! Compiling Tk 8.5b1 without xft (by specifying --disable-xft to configure) makes the problem with Tktable go away, without causing any other visible adverse effects! I can now build Tktable as normal without the special NO_XSETCLIP definition and it works as normal. What's more, tables now draw over twice as fast! I am still curious as to what Xft exactly does that interferes with the clip-mask. Presumably, if my understanding about Xft using client-side fonts is correct, it must load the glyphs into a pixmap and then use XCopyPlane to draw them--perhaps it manipulates the clip-mask to control the font rendering, causing the observed problems. In any case, the problem is basically solved for me now. Thanks for your help so far hobbs, and sorry I was not able immediately to give you the information you required.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2008-11-14

    Use NO_XSETCLIP on all platforms until the Xft clipping issue is resolved in the core.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2008-11-14
    • status: open --> closed-fixed
     
  • Christopher Chavez

    I'm not sure the Xft clipping bug in core Tk was ever reported; it still exists, so I have opened a ticket: https://core.tcl-lang.org/tk/info/4476fd6144

     

Log in to post a comment.

MongoDB Logo MongoDB