]> Dogcows Code - chaz/openbox/blobdiff - openbox/prompt.c
Handle STRING and COMPOUND_TEXT type text properties.
[chaz/openbox] / openbox / prompt.c
index b10d8a18e91844349a7a2d9e78060ea0cea957cb..08356092693c875c1bb92be78450220ea5375568 100644 (file)
@@ -152,7 +152,7 @@ ObPrompt* prompt_new(const gchar *msg, const gchar *title,
 
     attrib.override_redirect = FALSE;
 
-    self = g_new0(ObPrompt, 1);
+    self = g_slice_new0(ObPrompt);
     self->ref = 1;
     self->func = func;
     self->cleanup = cleanup;
@@ -175,7 +175,7 @@ ObPrompt* prompt_new(const gchar *msg, const gchar *title,
 
     /* set the window's title */
     if (title)
-        OBT_PROP_SETS(self->super.window, NET_WM_NAME, utf8, title);
+        OBT_PROP_SETS(self->super.window, NET_WM_NAME, title);
 
     /* listen for key presses on the window */
     self->event_mask = KeyPressMask;
@@ -250,7 +250,7 @@ void prompt_unref(ObPrompt *self)
 
         XDestroyWindow(obt_display, self->msg.window);
         XDestroyWindow(obt_display, self->super.window);
-        g_free(self);
+        g_slice_free(ObPrompt, self);
     }
 }
 
@@ -269,9 +269,8 @@ static void prompt_layout(ObPrompt *self)
     b += OUTSIDE_MARGIN;
 
     {
-        Rect *area = screen_physical_area_all_monitors();
+        const Rect *area = screen_physical_area_all_monitors();
         maxw = MIN(MAX_WIDTH, area->width*4/5);
-        g_free(area);
     }
 
     /* find the button sizes and how much space we need for them */
@@ -463,7 +462,7 @@ void prompt_show(ObPrompt *self, ObClient *parent, gboolean modal)
         /* activate the prompt */
         OBT_PROP_MSG(ob_screen, self->super.window, NET_ACTIVE_WINDOW,
                      1, /* from an application.. */
-                     event_curtime,
+                     event_time(),
                      0,
                      0, 0);
         return;
@@ -541,7 +540,7 @@ gboolean prompt_key_event(ObPrompt *self, XEvent *e)
 
     if (sym == XK_Escape)
         prompt_cancel(self);
-    else if (sym == XK_Return || sym == XK_space)
+    else if (sym == XK_Return || sym == XK_KP_Enter || sym == XK_space)
         prompt_run_callback(self, self->focus->result);
     else if (sym == XK_Tab || sym == XK_Left || sym == XK_Right) {
         gint i;
This page took 0.023688 seconds and 4 git commands to generate.