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 --- a/src/matchbox-keyboard.c 2007-08-17 17:09:05.240878162 +0300
47 +++ b/src/matchbox-keyboard.c 2007-08-17 17:11:36.749512174 +0300
49 " -xid,--xid Print window ID to stdout ( for embedding )\n"
50 " -d,--daemon Run in 'daemon' mode (for remote control)\n"
51 " -o,--orientation <portrait|landscape>\n"
52 - " Use to limit visibility with screen orientation \n");
53 + " Use to limit visibility with screen orientation \n"
54 + " -h,--hfactor <percent>\n"
55 + " Fix keyboard window size in percentage of desktop height\n");
56 fprintf(stderr, "\nmatchbox-keyboard %s \nCopyright (C) 2007 OpenedHand Ltd.\n", VERSION);
62 kb->font_family = strdup("sans");
63 - kb->font_pt_size = 5;
64 + kb->font_pt_size = 6;
65 kb->font_variant = strdup("bold");
67 for (i = 1; i < argc; i++)
72 + if (streq ("-h", argv[i]) || streq ("--hfactor", argv[i]))
75 + kb->hfactor = atoi(argv[i + 1]);
80 if (streq ("-d", argv[i]) || streq ("--daemon", argv[i]))
83 diff -r ff9cf1fd8177 -r b010d54a6c50 src/matchbox-keyboard.h
84 --- a/src/matchbox-keyboard.h Sun Apr 08 23:56:09 2007 +0000
85 +++ b/src/matchbox-keyboard.h Mon Apr 09 00:06:34 2007 +0000
93 MBKeyboardLayout *selected_layout;