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

Re: gEDA-dev: Rendering bug in attributes pane



On Tue, 2006-10-17 at 00:30 +0100, Peter Clifton wrote:
[snip]

> It appears that now, the code which adds the editing widget checks to
> see what size the editing widget wants to requisition, and if smaller
> than the cell size, shrinks the widget. In our case, the text editing
> widget doesn't ask for any height. (Haven't dug into this further yet),
> and we get a rendering bug. (And a virtually unusable multi-attribute
> editor).
> 
> Our widget needs to ask for a sensible size when:
> 
> gtk_widget_size_request (GTK_WIDGET (cell_editable), &requisition);
> 
> gets called.

Further to this.. it appears that the gtk_text_view we subclass doesn't
want to tell us its size. Since I'm not all that familiar with the
(perhaps necessarily) complicated way which GTK handles widget
allocation, I'm not sure exactly what is going on here.

There "might" be a race between the gtktreeview wanting to know the size
before realising the widget, and the gtktextview not knowing its size
until afterwards?

Breakpoint 2, gtk_text_view_size_request (widget=0x82fba20, 
    requisition=0xbfcf4960) at gtktextview.c:2764
2764    in gtktextview.c
(gdb) print *(GtkTextView *)0x82fba20
$1 = {parent_instance = {widget = {object = {parent_instance = {
          g_type_instance = {g_class = 0x8313c78}, ref_count = 1, 
          qdata = 0x8370910}, flags = 2100738}, private_flags = 13312, 
      state = 0 '\0', saved_state = 0 '\0', name = 0x0, style =
0x8146098, 
      requisition = {width = 0, height = 0}, allocation = {x = -1, y =
-1, 
        width = 1, height = 1}, window = 0x0, parent = 0x0}, 
    focus_child = 0x0, border_width = 0, need_resize = 0, resize_mode =
0, 
    reallocate_redraws = 0, has_focus_chain = 0}, layout = 0x8311720, 
  buffer = 0x83758d0, selection_drag_handler = 0, scroll_timeout = 0, 
  pixels_above_lines = 0, pixels_below_lines = 0, pixels_inside_wrap =
0, 
  wrap_mode = GTK_WRAP_NONE, justify = GTK_JUSTIFY_LEFT, left_margin =
0, 
  right_margin = 0, indent = 0, tabs = 0x0, editable = 1, overwrite_mode
= 0, 
  cursor_visible = 1, need_im_reset = 0, accepts_tab = 1, width_changed
= 0, 
  onscreen_validated = 0, mouse_cursor_obscured = 0, text_window =
0x8371a80, 
  left_window = 0x0, right_window = 0x0, top_window = 0x0, 
  bottom_window = 0x0, hadjustment = 0x0, vadjustment = 0x0, xoffset =
0, 
  yoffset = 0, width = 0, height = 0, virtual_cursor_x = -1, 
  virtual_cursor_y = -1, first_para_mark = 0x836e270, first_para_pixels
= 0, 
  dnd_mark = 0x836e420, blink_timeout = 0, first_validate_idle = 160, 
  incremental_validate_idle = 161, im_context = 0x8351660, popup_menu =
0x0, 
  drag_start_x = -1, drag_start_y = -1, children = 0x0, pending_scroll =
0x0, 
  pending_place_cursor_button = 0}


It looks like the widget is fairly uninitialised at this point:

requisition = {width = 0, height = 0}, allocation = {x = -1, y = -1, 
        width = 1, height = 1}, window = 0x0, parent = 0x0}, 
    focus_child = 0x0, border_width = 0, need_resize = 0, resize_mode =
0, 
    reallocate_redraws = 0, has_focus_chain = 0}

admittedly, gtk_text_view_size_request actually sets some of these
rather than reading them, but I'm unsure whether the layout member
actually has any sensible value at this point.

It contains:

(gdb) print *((GtkTextView *)0x82fba20)->layout
$4 = {parent_instance = {g_type_instance = {g_class = 0x82fd748}, 
    ref_count = 2, qdata = 0x0}, screen_width = 0, width = 0, height =
0, 
  buffer = 0x83758d0, default_style = 0x0, ltr_context = 0x0, 
  rtl_context = 0x0, one_style_cache = 0x0, one_display_cache = 0x0, 
  wrap_loop_count = 0, cursor_visible = 0, cursor_direction = 0, 
  keyboard_direction = 0, preedit_string = 0x0, preedit_attrs = 0x0, 
  preedit_len = 0, preedit_cursor = 0}


I'm not sure I can do much more.. I'm not that familiar with the GTK
internals involved, and not sure if it is even our bug. Does anyone have
any ideas?

Regards

Peter Clifton




_______________________________________________
geda-dev mailing list
geda-dev@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev