2 # User pfalcon@localhost
4 # Node ID b010d54a6c5020a68855e60e5a423ee3c18ed700
5 # Parent ff9cf1fd8177dded04b9fc81ba630203848fc3ca
6 Changes to improve layout rendering, especially after adding support for
8 1. Add --hfactor option which presets keyboard to the specified percentage
9 of screen height. This is required for multiple layouts, as otherwise
10 height is calculated on specific layout, but in such a way that it is
11 affected by previous layout, which leads to rendering artifacts.
12 2. Also st default font height to 6, after all.
14 diff -r ff9cf1fd8177 -r b010d54a6c50 src/matchbox-keyboard-ui.c
15 --- a/src/matchbox-keyboard-ui.c Sun Apr 08 23:56:09 2007 +0000
16 +++ b/src/matchbox-keyboard-ui.c Mon Apr 09 00:06:34 2007 +0000
17 @@ -744,9 +744,15 @@ mb_kbd_ui_resources_create(MBKeyboardUI
19 if (desk_width > ui->xwin_width)
22 + if (ui->kbd->hfactor != 0)
23 + win_height = desk_height * ui->kbd->hfactor / 100;
25 + win_height = ( desk_width * ui->xwin_height ) / ui->xwin_width;
29 - ( desk_width * ui->xwin_height ) / ui->xwin_width);
33 wm_struct_vals[2] = desk_y + desk_height - ui->xwin_height;
34 @@ -818,8 +824,11 @@ mb_kbd_ui_resize(MBKeyboardUI *ui, int w
35 width_diff = width - ui->base_alloc_width;
36 height_diff = height - ui->base_alloc_height;
38 +/* It's better to have some "clipped" keys, than busted layout. */
40 if (width_diff < 0 || height_diff < 0)
41 return; /* dont go smaller than our int request - get clipped */
44 layout = mb_kbd_get_selected_layout(ui->kbd);
45 row_item = mb_kbd_layout_rows(layout);
46 diff -r ff9cf1fd8177 -r b010d54a6c50 src/matchbox-keyboard.c
47 --- a/src/matchbox-keyboard.c Sun Apr 08 23:56:09 2007 +0000
48 +++ b/src/matchbox-keyboard.c Mon Apr 09 00:06:34 2007 +0000
49 @@ -23,8 +23,9 @@ mb_kbd_usage (char *progname)
50 mb_kbd_usage (char *progname)
52 fprintf(stderr, "Usage:\n %s [Options ] [ Layout Variant ]\n", progname);
53 - fprintf(stderr, "\nOptions are;\n"
54 - " -xid,--xid Print window ID to stdout ( for embedding )\n");
55 + fprintf(stderr, "\nOptions are:\n"
56 + " -xid,--xid Print window ID to stdout ( for embedding )\n"
57 + " --hfactor <percent> Fix keyboard window size in percentage of desktop height\n");
58 fprintf(stderr, "\nmatchbox-keyboard %s \nCopyright (C) 2005 Matthew Allum, OpenedHand Ltd.\n", VERSION);
61 @@ -58,6 +59,13 @@ mb_kbd_new (int argc, char **argv)
62 want_embedding = True;
65 + if (streq ("-hfactor", argv[i]) || streq ("--hfactor", argv[i]))
68 + kb->hfactor = atoi(argv[i + 1]);
73 if (i == (argc-1) && argv[i][0] != '-')
75 @@ -77,7 +85,7 @@ mb_kbd_new (int argc, char **argv)
79 - kb->font_pt_size = 5;
80 + kb->font_pt_size = 6;
83 if (!mb_kbd_config_load(kb, variant))
84 diff -r ff9cf1fd8177 -r b010d54a6c50 src/matchbox-keyboard.h
85 --- a/src/matchbox-keyboard.h Sun Apr 08 23:56:09 2007 +0000
86 +++ b/src/matchbox-keyboard.h Mon Apr 09 00:06:34 2007 +0000
87 @@ -143,6 +143,7 @@ struct MBKeyboard