Re: Toolbar problem



Andrew E. Makeev wrote:

David Nečas (Yeti) wrote:

On Fri, May 19, 2006 at 03:39:36PM +0400, Andrew E. Makeev wrote:
There is small test case.
It shows problem with toolbar button - if disabled/enabled it loses state that pointer is still over the button.
Steps:
1. run application
2. move mouse pointer over toolbar item
3. wait 2 seconds (timeout callback)
4. you will notice that you can't activate item pressing MB1
5. move pointer out toolbar item and back again
6. press MB1
7. after handler done you can't use MB1 to actiave toolbar item

Versions: Gtk+ 2.4.14, Gtkmm 2.4.11

Questions:
1. Is it known issue?


I suppose this is another example of

 http://bugzilla.gnome.org/show_bug.cgi?id=56070

2. Was it fixed in latest Gtk+?


AFAIK no.

3. How could I reactivate toolitem without moving mouse pointer out/to toolbutton?


By running gtk_widget_hide(), gtk_widget_show() on that
widget.  Ugly, but still the best workaround I know.

Well, I found another problem.
We have GTK+ 2.8.17 built on Win32 (Linux version works well).
Running gtk-demo shows following problem:
Buttons and toolitems that run dialog on click (for example, Pickers - color, font, file) becomes "inactive" if you are closing dialog and mouse pointer is not moved out/to button.
In this case hide() / show() calls do not help.

It is strange, but if you close color dialog with <Escape> then button remains active, and when you hit <Return> there is a chance button will be active first few times (1-3).

Well, another solution for "inactive" buttons. I wonder if somebody from GTK+ developers could use it in proper place of gtkbutton.c file.

       void fix_button( GtkWidget* widget )
       {
            gint width, height;
            gint x, y;

            g_return_if_fail( GTK_IS_BUTTON( widget ) );

// button dimensions
            width = widget->allocation.width;
            height = widget->allocation.height;
// mouse pointer in widget coordinates
            gtk_widget_get_pointer( widget, &x, &y );
// check if pointer is over button
            if( x >= 0 && x < width && y >= 0 && y < height )
                GTK_BUTTON( widget )->in_button = true;
// setting
       }

I found why my GTK+ 2.4.11 (on Linux) works well vs GTK+ 2.8.17. There is function gtk_button_grab_notify that drop in_button flag. Also, gtk_button_update_state drops in_button flag when button widget is insensitive, but doesn't restore it in other case. Let me know if you need issue submitted at bugzilla and test case to fix that bug faster.

Regards,
-andrew




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