Re: Unmaximize event



I whipped up a quick test and it appears to work:

#include <gtk/gtk.h>

gboolean window_state(GtkWidget *widget, GdkEventWindowState *event)
{
static gint unmax_count = 0;
if (event->changed_mask == GDK_WINDOW_STATE_MAXIMIZED)
if ((event->new_window_state != GDK_WINDOW_STATE_MAXIMIZED))
g_print("Unmaximized count: %d\n",unmax_count++);

return FALSE;
}

int main(int argc,char **argv)
{
GtkWidget *window;
gtk_init(&argc,&argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

gtk_signal_connect(GTK_OBJECT(window),"destroy",
GTK_SIGNAL_FUNC(gtk_main_quit),"WM DESTROY");

gtk_signal_connect(GTK_OBJECT(window),"window-state-event",
GTK_SIGNAL_FUNC(window_state),NULL);

gtk_widget_show(window);
gtk_main();

return 0;

}



Steve

On Sat, Nov 26, 2011 at 5:02 AM, Steve . <iteration69 gmail com> wrote:

I just joined this list so I'm not certain of the reply etiquette when the
context is not available, so i just included the original context here.

Dipesh,

Looking at defintion:

struct GdkEventWindowState {
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkWindowState changed_mask;
GdkWindowState new_window_state;
};

I believe the combination of changed_mask and new_window_state will
provide what you need.

http://developer.gnome.org/gdk/stable/gdk-Event-Structures.html#GdkEvent


Steve


---------------------------------
From: Dipesh Sudershan <d1p3shn0mad gmail com>
To: Gtk+ Devel Mailing List <gtk-app-devel-list gnome org>
Subject: Unmaximize event
Date: Tue, 22 Nov 2011 11:56:07 +0530
I know window-state-event is used to check whenever a window is
maximized. But is there a way to check whether a window has been
unmaximized. I don't want to check a window is in unmaximized state or
not. I want to check a window has been unmaximized when the
window-state-event is emitted. Any help is appreciated..




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