After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 681977 - Hiding then showing window makes GtkEntry insensitive on Windows 7
Hiding then showing window makes GtkEntry insensitive on Windows 7
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkEntry
2.24.x
Other Windows
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-08-16 09:30 UTC by zxjlwt
Modified: 2018-05-02 15:29 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description zxjlwt 2012-08-16 09:30:43 UTC
os : windows 7
gtk+2

here is mine code :

void tray_activate(GObject *trayIcon, gpointer window) {
gtk_widget_show(window);
gtk_window_deiconify(window);
}

gboolean window_state_event_change(GtkWidget *widget, GdkEventWindowState *event, gpointer trayIcon) {
if (event->changed_mask == GDK_WINDOW_STATE_ICONIFIED &&
(event->new_window_state == GDK_WINDOW_STATE_ICONIFIED ||
event->new_window_state == (GDK_WINDOW_STATE_ICONIFIED |
GDK_WINDOW_STATE_MAXIMIZED))) {
gtk_widget_hide(widget);
gtk_status_icon_set_visible(GTK_STATUS_ICON(trayIcon), TRUE);
}
return FALSE;
}

int main(void) {
GtkWidget *window;
GtkWidget *text;
GtkStatusIcon *trayIcon;

gtk_init(NULL, NULL);

window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
g_signal_connect(window, "destroy", G_CALLBAK(gtk_main_quit), NULL);

trayIcon = gtk_status_icon_from_file("e://hao.icon");
g_signal_connect(trayIcon, "activate", tray_activate, window);

g_signal_connect(window, "window-state-event", G_CALLBACK(window_state_event_chagne), trayIcon);

text = gtk_entry_new();
gtk_container_add(GTK_CONTAINER(window), text);
gtk_widget_show(text);

gtk_widget_show(window);

gtk_main();

return 0;
}


these codes, in linux is good.
but in my "windows 7 os", when call gtk_widget_show(window) again, then text will be disabled.
Comment 1 Daniel Boles 2017-09-05 16:26:31 UTC
(In reply to zxjlwt from comment #0)
> os : windows 7
> gtk+2

So don't tag it as GTK+ 3, please. GTK+ 3 does not seem to share this problem.


> here is mine code :
> these codes, in linux is good.

I doubt that. It doesn't even compile. There's no G_CALLBAK, no gtk_status_icon_from_file(), no window_state_event_chagne(), etc.


After fixing all that...

> but in my "windows 7 os", when call gtk_widget_show(window) again, then text
> will be disabled.

This does seem to happen for me, too.

Swapping the calls to show() and deiconify() works around it. => not "major"


On exit, I get this:

> (a.exe:1940): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

so maybe the program is doing something undefined and confusing GTK+. I didn't go over it with a fine-toothed comb yet.
Comment 2 GNOME Infrastructure Team 2018-05-02 15:29:15 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/403.