Re: Sluggish graphics



Russell Shaw wrote:
Hi,
In a thread, i call gdk_window_get_pointer(drawing_area->window,x,y,NULL).
If the window is 400x400, the call takes 0.13ms. However, if i make the
window close to full screen size, the call takes 300-350ms. And the mouse
cursor only responds to movement every ~300ms too. It happens about 70%
of the time. The other 30%, the call still takes ~0.15ms for a full window.

Within the thread, gdk_window_get_pointer(...) is being called 10 times/sec.

I have nothing being drawn in this window, or any others.
(500MHz PIII system, GTK2)

drawing_area created as:

   drawing_area=gtk_drawing_area_new();

   gtk_widget_set_events(drawing_area,
          GDK_EXPOSURE_MASK
        | GDK_ENTER_NOTIFY_MASK
        | GDK_BUTTON_PRESS_MASK
        | GDK_BUTTON_RELEASE_MASK
        | GDK_KEY_PRESS_MASK
        | GDK_KEY_RELEASE_MASK);
  ...
  gdk_threads_enter();
  gtk_main();
  gdk_threads_leave();

Solved. I had a huge memory leak. I put this in the configure
event callback:

  if(cache_pixmap)
    g_object_unref(G_OBJECT(cache_pixmap));

Without it, lots of server memory gets used when you make the
window bigger, which generates lots of configure events.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]