Results 1 to 3 of 3

Thread: Gtk + Cairo + Size Change = Corruption

  1. #1
    Join Date
    Feb 2007
    Beans
    16
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Gtk + Cairo + Size Change = Corruption

    Hi,
    I have an application that can be viewed in full screen. When it's in full screen, I use Cairo to draw a nice border so it's not too ugly. (See first screenshot.) But, when the size changes where the border would be extended up and down, the image is corrupted. (See second screenshot.) Changing back to a smaller size still leaves corruption.
    This happens both in full screen and normal size. In full screen, changing the workspace or exiting and re-entering full screen fixes the corruption. In normal size, only minimizing and unminimizing the window fixes the corruption. Hovering over the buttons to force a re-expose doesn't fix it.
    This occurs on both Intel graphics with Intrepid's driver and ATI graphics with Jaunty. It is just a coincidence that it's corrupted for both, or am I doing something wrong somewhere?

    This is the .c file. Here is a PPA if you want to try it.

    Thanks.
    Attached Images Attached Images
    Last edited by sharkbaitbobby2; July 5th, 2009 at 02:12 AM.

  2. #2
    Join Date
    Jan 2009
    Beans
    309
    Distro
    Ubuntu Development Release

    Re: Gtk + Cairo + Size Change = Corruption

    Try calling gtk_widget_queue_draw() after disconnecting your expose handler to force the window to get redrawn by gtk

  3. #3
    Join Date
    Feb 2007
    Beans
    16
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Gtk + Cairo + Size Change = Corruption

    I only disconnected the expose handler when it exits fullscreen, and it redraws correctly. But I tried doing gtk_widget_queue_draw() on the window (the widget "expose-event" is connected to) when the back and forward buttons are clicked, and it works now! Thanks!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •