[maemo-commits] [maemo-commits] r12457 - in projects/haf/trunk/hildon-desktop: . libhildonwm src
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Tue Jun 26 11:20:41 EEST 2007
- Previous message: [maemo-commits] r12456 - in projects/haf/trunk/hildon-desktop: . libhildondesktop
- Next message: [maemo-commits] r12458 - in projects/haf/branches/hildon-control-panel/refactoring: . src
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: moimart Date: 2007-06-26 11:20:26 +0300 (Tue, 26 Jun 2007) New Revision: 12457 Modified: projects/haf/trunk/hildon-desktop/ChangeLog projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-window.c projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-window.h projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.c projects/haf/trunk/hildon-desktop/src/hn-app-switcher.c Log: 2007-06-26 Moises Martinez <moises.martinez at nokia.com> * libhildonwm/hd-wm.c: Some optimizations. * libhildonwm/hd-wm-window.[ch]: Added _set_icon_geometry method * src/hn-app-switcher.c: Added _set_icon_geometry calls * ChangeLog updated. Modified: projects/haf/trunk/hildon-desktop/ChangeLog =================================================================== --- projects/haf/trunk/hildon-desktop/ChangeLog 2007-06-26 07:02:21 UTC (rev 12456) +++ projects/haf/trunk/hildon-desktop/ChangeLog 2007-06-26 08:20:26 UTC (rev 12457) @@ -1,3 +1,9 @@ +2007-06-26 Moises Martinez <moises.martinez at nokia.com> + + * libhildonwm/hd-wm.c: Some optimizations. + * libhildonwm/hd-wm-window.[ch]: Added _set_icon_geometry method + * src/hn-app-switcher.c: Added _set_icon_geometry calls + 2007-06-26 Johan Bilien <johan.bilien at nokia.com> * libhildondesktop/hildon-home-area.c: Fixed build without composite Modified: projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-window.c =================================================================== --- projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-window.c 2007-06-26 07:02:21 UTC (rev 12456) +++ projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-window.c 2007-06-26 08:20:26 UTC (rev 12457) @@ -62,6 +62,14 @@ #define HIBERNATION_TIMEMOUT 3000 /* as suggested by 31410#10 */ +enum +{ + HDWM_WIN_CLOSE_WINDOW_SIGNAL, + HDWM_WIN_N_SIGNALS +}; + +gint hdwm_win_signals [HDWM_WIN_N_SIGNALS]; + static void hd_wm_window_entry_info_init (HDWMEntryInfoIface *iface); G_DEFINE_TYPE_WITH_CODE (HDWMWindow,hd_wm_window,G_TYPE_OBJECT, @@ -113,6 +121,7 @@ HDWMEntryInfo *parent; gboolean ignore_urgent; gboolean info_init; + gboolean override_icon_geometry; }; struct xwinv @@ -445,6 +454,8 @@ HN_DBG("Removing '%s'", win->priv->name); + g_signal_emit_by_name (object, "close-window", win); + /* Dont destroy windows that are hiberating */ if (hd_wm_window_is_hibernating (win)) { @@ -521,8 +532,10 @@ watched->priv = HD_WM_WINDOW_GET_PRIVATE (watched); watched->priv->parent = NULL; - watched->priv->ignore_urgent = FALSE; - watched->priv->info_init = FALSE; + + watched->priv->info_init = + watched->priv->ignore_urgent = + watched->priv->override_icon_geometry = FALSE; } static void @@ -533,6 +546,15 @@ object_class->finalize = hd_wm_window_finalize; g_type_class_add_private (watched_class, sizeof (HDWMWindowPrivate)); + + hdwm_win_signals[HDWM_WIN_CLOSE_WINDOW_SIGNAL] = + g_signal_new("close-window", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_FIRST, + 0, + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); } static void @@ -1250,3 +1272,40 @@ return FALSE; } +void +hd_wm_window_set_icon_geometry (HDWMWindow *win, + gint x, + gint y, + gint width, + gint height, + gboolean override) +{ + gulong data[4]; + gboolean old_override_flag; + GdkDisplay *display = gdk_x11_lookup_xdisplay (GDK_DISPLAY ()); + + g_return_if_fail (win != NULL && HD_WM_IS_WINDOW (win)); + + old_override_flag = win->priv->override_icon_geometry; + + win->priv->override_icon_geometry = override; + + if (!old_override_flag && !override) + return; + + data[0] = x; + data[1] = y; + data[2] = width; + data[3] = height; + + gdk_error_trap_push (); + + XChangeProperty (GDK_DISPLAY (), + hd_wm_window_get_x_win (win), + gdk_x11_get_xatom_by_name_for_display (display,"_NET_WM_ICON_GEOMETRY"), + XA_CARDINAL, 32, PropModeReplace, + (guchar *)&data, 4); + + gdk_error_trap_pop (); +} + Modified: projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-window.h =================================================================== --- projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-window.h 2007-06-26 07:02:21 UTC (rev 12456) +++ projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-window.h 2007-06-26 08:20:26 UTC (rev 12457) @@ -174,6 +174,13 @@ gboolean hd_wm_window_is_active (HDWMWindow *win); +void +hd_wm_window_set_icon_geometry (HDWMWindow *win, + gint x, + gint y, + gint width, + gint height, + gboolean override); G_END_DECLS Modified: projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.c =================================================================== --- projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.c 2007-06-26 07:02:21 UTC (rev 12456) +++ projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.c 2007-06-26 08:20:26 UTC (rev 12457) @@ -1901,8 +1901,7 @@ else if (HD_WM_IS_APPLICATION (entry_info)) { - g_warning ("asked to append HD_ENTRY_APPLICATION " - "-- this should not happen"); + g_warning ("asked to append HD_WM_APPLICATION!!!!!!"); } } @@ -1943,20 +1942,13 @@ * hibernating, and if they are, wake one of them up, because * we will not receive current window msg from MB */ - GList * l; + GList *l; gboolean all_asleep = TRUE; for (l = hdwm->priv->applications; l != NULL; l = l->next) { - HDWMEntryInfo *entry = l->data; - HDWMApplication *app = NULL; + HDWMApplication *app = HD_WM_APPLICATION (l->data); - if (HD_WM_IS_APPLICATION (entry)) - app = HD_WM_APPLICATION (app); - else - if (HD_WM_IS_WINDOW (entry)) - app = hd_wm_window_get_application (HD_WM_WINDOW (entry)); - if (app && !hd_wm_application_is_hibernating (app)) { all_asleep = FALSE; @@ -1983,7 +1975,6 @@ return hdwm->priv->applications; } - static void hd_wm_process_x_client_list (HDWM *hdwm) { Modified: projects/haf/trunk/hildon-desktop/src/hn-app-switcher.c =================================================================== --- projects/haf/trunk/hildon-desktop/src/hn-app-switcher.c 2007-06-26 07:02:21 UTC (rev 12456) +++ projects/haf/trunk/hildon-desktop/src/hn-app-switcher.c 2007-06-26 08:20:26 UTC (rev 12457) @@ -570,15 +570,14 @@ for (l = children; l != NULL; l = l->next) { HDWMEntryInfo *_info = HD_WM_ENTRY_INFO (l->data); -#if 0 + if (update_icon_geometry || app_switcher->priv->orientation_changed) - hd_entry_info_set_icon_geometry (l->data, - GTK_WIDGET (app_button)->allocation.x, - GTK_WIDGET (app_button)->allocation.y, - GTK_WIDGET (app_button)->allocation.width, - GTK_WIDGET (app_button)->allocation.height, - TRUE); -#endif + hd_wm_window_set_icon_geometry (HD_WM_WINDOW (l->data), + GTK_WIDGET (app_button)->allocation.x, + GTK_WIDGET (app_button)->allocation.y, + GTK_WIDGET (app_button)->allocation.width, + GTK_WIDGET (app_button)->allocation.height, + TRUE); /* * If the entry is urgent and the ignore flag is not set, the button * should blink @@ -676,14 +675,12 @@ } else { -#if 0 - hd_entry_info_set_icon_geometry (l->data, - GTK_WIDGET (app_switcher)->allocation.x, - GTK_WIDGET (app_switcher)->allocation.y, - GTK_WIDGET (app_switcher)->allocation.width, - GTK_WIDGET (app_switcher)->allocation.height, - FALSE); -#endif + hd_wm_window_set_icon_geometry (HD_WM_WINDOW (l->data), + GTK_WIDGET (app_switcher)->allocation.x, + GTK_WIDGET (app_switcher)->allocation.y, + GTK_WIDGET (app_switcher)->allocation.width, + GTK_WIDGET (app_switcher)->allocation.height, + FALSE); } }
- Previous message: [maemo-commits] r12456 - in projects/haf/trunk/hildon-desktop: . libhildondesktop
- Next message: [maemo-commits] r12458 - in projects/haf/branches/hildon-control-panel/refactoring: . src
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]