All pastes #70216 Raw Edit

Unnamed

public text v1 · immutable
#70216 ·published 2006-06-23 22:15 UTC
rendered paste body
Index: window.c
===================================================================
--- window.c    (revision 2623)
+++ window.c    (working copy)
@@ -3078,6 +3078,15 @@
        strncpy(wi->title, g->title, sizeof(wi->title));
        wi->title[sizeof(wi->title) - 1] = '\0';
 
+       if (wimptextop_string_width(wi->title, 0) > 128) {
+               /* work around bug in Pinboard where it will fail to display
+                * the icon if the text is very wide */
+               if (strlen(wi->title) > 10)
+                       wi->title[10] = '\0';   /* pinboard does this anyway */
+               while (wimptextop_string_width(wi->title, 0) > 64 * 2)
+                       wi->title[strlen(wi->title) - 1] = '\0';
+       }
+
        wi->size = sizeof(wimp_full_message_window_info);
        wi->your_ref = wi->my_ref;
        error = xwimp_send_message(wimp_USER_MESSAGE, (wimp_message*)wi, wi->sender);