diff options
Diffstat (limited to 'src/libui_sdl/libui/unix')
-rw-r--r-- | src/libui_sdl/libui/unix/area.c | 26 | ||||
-rw-r--r-- | src/libui_sdl/libui/unix/stddialogs.c | 3 | ||||
-rw-r--r-- | src/libui_sdl/libui/unix/window.c | 7 |
3 files changed, 27 insertions, 9 deletions
diff --git a/src/libui_sdl/libui/unix/area.c b/src/libui_sdl/libui/unix/area.c index 40f8624..2da9bab 100644 --- a/src/libui_sdl/libui/unix/area.c +++ b/src/libui_sdl/libui/unix/area.c @@ -523,16 +523,26 @@ char* uiKeyName(int scancode) { scancode = scancode_normal2unix(scancode); + char* ret; guint* keyvals; int num; - GdkKeymap* keymap = gdk_keymap_get_default(); - gdk_keymap_get_entries_for_keycode(keymap, scancode, NULL, &keyvals, &num); - - // TODO: pick smarter?? - int keyval = keyvals[0]; - - g_free(keyvals); + GdkKeymap* keymap = gdk_keymap_get_for_display(gdk_display_get_default()); + if (gdk_keymap_get_entries_for_keycode(keymap, scancode, NULL, &keyvals, &num)) + { + // TODO: pick smarter?? + int keyval = keyvals[0]; + + g_free(keyvals); + + ret = gdk_keyval_name(keyval); + } + else + { + char tmp[16]; + sprintf(tmp, "#%03X", scancode); + ret = tmp; + } - return uiUnixStrdupText(gdk_keyval_name(keyval)); + return uiUnixStrdupText(ret); } enum { diff --git a/src/libui_sdl/libui/unix/stddialogs.c b/src/libui_sdl/libui/unix/stddialogs.c index b793d06..d2b89b9 100644 --- a/src/libui_sdl/libui/unix/stddialogs.c +++ b/src/libui_sdl/libui/unix/stddialogs.c @@ -70,6 +70,9 @@ static char *filedialog(GtkWindow *parent, GtkFileChooserAction mode, const gcha gtk_file_chooser_set_show_hidden(fc, TRUE); gtk_file_chooser_set_do_overwrite_confirmation(fc, TRUE); gtk_file_chooser_set_create_folders(fc, TRUE); + if (initpath && strlen(initpath)>0) + gtk_file_chooser_set_current_folder(fc, initpath); + response = gtk_dialog_run(GTK_DIALOG(fcd)); if (response != GTK_RESPONSE_ACCEPT) { gtk_widget_destroy(fcd); diff --git a/src/libui_sdl/libui/unix/window.c b/src/libui_sdl/libui/unix/window.c index a3dde76..04630bc 100644 --- a/src/libui_sdl/libui/unix/window.c +++ b/src/libui_sdl/libui/unix/window.c @@ -145,11 +145,16 @@ static void uiWindowShow(uiControl *c) gtk_window_resize(w->window, width, height); } +static void uiWindowSetFocus(uiControl* c) +{ + gtk_window_present(GTK_WINDOW(uiWindow(c)->widget)); +} + uiUnixControlDefaultHide(uiWindow) uiUnixControlDefaultEnabled(uiWindow) uiUnixControlDefaultEnable(uiWindow) uiUnixControlDefaultDisable(uiWindow) -uiUnixControlDefaultSetFocus(uiWindow) +//uiUnixControlDefaultSetFocus(uiWindow) uiUnixControlDefaultSetMinSize(uiWindow) // TODO? uiUnixControlDefaultSetContainer(uiWindow) |