Loading ...
Sorry, an error occurred while loading the content.

[vim-multibyte] Re: gtk-XIM patch (was Syncup for GTK+)

Expand Messages
  • Sung-Hyun Nam
    ... And now, here is a patch for it from Chi-Deok Hwang. I applied this to VIM-5.5.28 and have no problem yet. This also fixes the :set guioptions+=b . namsh
    Message 1 of 1 , Oct 20, 1999
    • 0 Attachment
      On Thu, Jul 15, 1999 at 05:12:50 +0900, Chi-Deok Hwang wrote:
      >
      > It is possible to use the separate widget for status area, but not separate
      > window. Then client window will be mainwin and focus window be drawarea.
      > And GtkLabel or something containing status area will have mainwin's window
      > as it's parent window.
      > It is clean and really I wanted this senario. But old vim's layout/resizing
      > code was too hackish to implement this. My main aim was to try fix this
      > horrible resizing codes.
      > Next time I or Nam will remove XIM code from gui_gtk_f.c.

      And now, here is a patch for it from Chi-Deok Hwang.
      I applied this to VIM-5.5.28 and have no problem yet.
      This also fixes the ':set guioptions+=b'.

      namsh

      --- gui_gtk_f.c.orig Wed Oct 20 21:32:46 1999
      +++ gui_gtk_f.c Wed Oct 20 21:52:27 1999
      @@ -399,12 +399,6 @@

      requisition->width = form->width;
      requisition->height = form->height;
      -#ifdef USE_XIM
      - /*
      - * FIXME: This isn't the proper place to do this!
      - */
      - requisition->height += xim_get_status_area_height();
      -#endif

      tmp_list = form->children;

      @@ -798,10 +792,6 @@
      event.y = widget->allocation.y;
      event.width = widget->allocation.width;
      event.height = widget->allocation.height;
      -
      -#ifdef USE_XIM
      - event.height -= xim_get_status_area_height();
      -#endif

      gtk_widget_event (widget, (GdkEvent*) &event);
      }
      --- gui_gtk_x11.c.orig Wed Oct 20 21:32:55 1999
      +++ gui_gtk_x11.c Wed Oct 20 22:15:38 1999
      @@ -1614,6 +1614,15 @@
      /* Adjust input management behaviour to the capabilities of the new
      * fontset */
      xim_decide_input_style();
      + if (xim_get_status_area_height()) {
      + /* status area is required */
      + /* just create the empty label so that
      + mainwin will allocate the extra space for status area */
      + GtkWidget *label = gtk_label_new(" ");
      + gtk_widget_set_usize(label, 20, gui.char_height + 2);
      + gtk_box_pack_end(GTK_BOX(GTK_BIN(gui.mainwin)->child), label, FALSE, FALSE, 0);
      + gtk_widget_show(label);
      + }
      #endif

      /* Preserve the logical dimensions of the screen. */
      --- multbyte.c.orig Wed Oct 20 21:41:02 1999
      +++ multbyte.c Wed Oct 20 22:30:23 1999
      @@ -397,19 +397,19 @@
      return;

      attr = xic_attr;
      - widget = gui.drawarea;
      attrmask = 0;
      style = gdk_ic_get_style(xic);
      if ((style & GDK_IM_STATUS_MASK) == GDK_IM_STATUS_AREA)
      {
      if (gui.fontset && gui.fontset->type == GDK_FONT_FONTSET)
      {
      + widget = gui.mainwin;
      gdk_window_get_size(widget->window, &width, &height);

      attrmask |= GDK_IC_STATUS_AREA;
      - attr->status_area.x = gui.border_offset;
      - attr->status_area.y = height - gui.char_height - gui.border_offset;
      - attr->status_area.width = width - 2 * gui.border_offset;
      + attr->status_area.x = 0;
      + attr->status_area.y = height - gui.char_height - 1;
      + attr->status_area.width = width;
      attr->status_area.height = gui.char_height;
      }
      }
      @@ -815,7 +815,7 @@

      if (!gdk_im_ready())
      {
      - EMSG("Your GTK+ does not support XIM");
      + EMSG("Input Method Server is not running");
      return;
      }
      if ((xic_attr = gdk_ic_attr_new()) != NULL)
      @@ -828,7 +828,7 @@
      GtkWidget *widget = gui.drawarea;

      attr->style = xim_input_style;
      - attr->client_window = widget->window;
      + attr->client_window = gui.mainwin->window;

      if ((colormap = gtk_widget_get_colormap(widget)) !=
      gtk_widget_get_default_colormap())
      @@ -871,13 +871,13 @@
      }
      else
      {
      + gdk_window_get_size(gui.mainwin->window, &width, &height);
      attrmask |= GDK_IC_STATUS_AREA_REQ;
      - attr->status_area.x = gui.border_offset;
      - attr->status_area.y = height - gui.char_height - gui.border_offset;
      - attr->status_area.width = width - 2*gui.border_offset;
      + attr->status_area.x = 0;
      + attr->status_area.y = height - gui.char_height - 1;
      + attr->status_area.width = width;
      attr->status_area.height = gui.char_height;
      attr->status_fontset = gui.fontset;
      - attr->preedit_area.height -= gui.char_height;
      }
      }
      #endif
    Your message has been successfully submitted and would be delivered to recipients shortly.