#include "tilda-window.h"
#include "tilda-window-dbus-glue.h"
#include "tomboykeybinder.h"
#include "tilda-window.h"
#include "tilda-window-dbus-glue.h"
#include "tomboykeybinder.h"
if (gtk_notebook_get_n_pages (GTK_NOTEBOOK(self->notebook)) > 1)
gtk_notebook_set_show_tabs (GTK_NOTEBOOK(self->notebook), TRUE);
if (gtk_notebook_get_n_pages (GTK_NOTEBOOK(self->notebook)) > 1)
gtk_notebook_set_show_tabs (GTK_NOTEBOOK(self->notebook), TRUE);
if (gtk_notebook_get_n_pages (GTK_NOTEBOOK (self->notebook)) < 1)
{
debug_printf ("no terminals left, closing window %d\n", self->number);
if (gtk_notebook_get_n_pages (GTK_NOTEBOOK (self->notebook)) < 1)
{
debug_printf ("no terminals left, closing window %d\n", self->number);
- // FIXME: this doesn't handle animation!
+ /* This call sets the X11 window property _NET_WM_USER_TIME, which GTK+ normally
+ * sets for us. However, because this callback is activated via a global keybinding,
+ * we see the event before GDK / GTK+ does. Therefore, to get the focus, we must
+ * set the property ourselves. */
+ gdk_x11_window_set_user_time (GTK_WIDGET(self->window)->window,
+ tomboy_keybinder_get_current_event_time());
/* Focusing the term here works perfectly, near as I can tell */
tt = tilda_window_find_current_terminal (self);
/* Focusing the term here works perfectly, near as I can tell */
tt = tilda_window_find_current_terminal (self);
/* Somewhat of a "poison" value, incase we don't set this */
self->number = 0xdeadbeef;
/* Somewhat of a "poison" value, incase we don't set this */
self->number = 0xdeadbeef;
case TILDA_WINDOW_KEY:
tilda_window_try_to_bind_key (self, g_value_get_string (value));
debug_printf ("window key %s\n", self->key);
case TILDA_WINDOW_KEY:
tilda_window_try_to_bind_key (self, g_value_get_string (value));
debug_printf ("window key %s\n", self->key);
tilda_window_setup_real_transparency (self);
gtk_container_add (GTK_CONTAINER(self->window), self->notebook);
tilda_window_setup_real_transparency (self);
gtk_container_add (GTK_CONTAINER(self->window), self->notebook);
gtk_widget_show (self->notebook);
// FIXME: Remove these, and replace with reads from the config system
gtk_widget_show (self->notebook);
// FIXME: Remove these, and replace with reads from the config system
- g_object_set (G_OBJECT(self), "key", "F2", NULL);
+ gchar *mykey = g_strdup_printf ("F%d", self->number+3); // TERRIBLE HACK
+ g_object_set (G_OBJECT(self), "key", mykey, NULL);
+ g_free (mykey);
g_object_set (G_OBJECT(self), "x-position", 0, "y-position", 0, NULL);
g_object_set (G_OBJECT(self), "height", 400, "width", 1680, NULL);
g_object_set (G_OBJECT(self), "keep-above", TRUE, "stick", TRUE, NULL);
g_object_set (G_OBJECT(self), "x-position", 0, "y-position", 0, NULL);
g_object_set (G_OBJECT(self), "height", 400, "width", 1680, NULL);
g_object_set (G_OBJECT(self), "keep-above", TRUE, "stick", TRUE, NULL);
* NOTE: See the following for how to deal with GtkObject-derived things:
* http://library.gnome.org/devel/gtk/unstable/GtkObject.html
*/
* NOTE: See the following for how to deal with GtkObject-derived things:
* http://library.gnome.org/devel/gtk/unstable/GtkObject.html
*/
+ pspec = g_param_spec_pointer ("controller",
+ _("Pointer to window's controlling TildaController"),
+ NULL,
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
+
+ g_object_class_install_property (gobject_class,
+ TILDA_WINDOW_CONTROLLER,
+ pspec);
+
pspec = g_param_spec_string ("key",
_("Window's drop-down keybinding"),
NULL,
pspec = g_param_spec_string ("key",
_("Window's drop-down keybinding"),
NULL,