From 309d161f6d464fcea2de200bb3cb5a7cb784b6d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Mon, 24 Jul 2017 19:58:27 +0200 Subject: New upstream version 0.7.1 --- AUTHORS | 1 + CMakeLists.txt | 125 ++++++++++++-------- README.md | 2 +- resources/locale/ru/LC_MESSAGES/ru.po | 212 ++++++++++++++++++---------------- resources/ui/icon_select.ui | 18 +-- resources/ui/pie_options.ui | 51 ++------ resources/ui/preferences.ui | 33 +++--- resources/ui/slice_select.ui | 22 ++-- src/CMakeLists.txt | 13 +-- src/actionGroups/actionGroup.vala | 2 +- src/actionGroups/bookmarkGroup.vala | 93 ++++++++------- src/actionGroups/clipboardGroup.vala | 4 +- src/actionGroups/devicesGroup.vala | 5 +- src/actionGroups/groupRegistry.vala | 42 ++++--- src/actionGroups/menuGroup.vala | 5 +- src/actionGroups/sessionGroup.vala | 2 +- src/actionGroups/windowListGroup.vala | 198 +++++++++++++++++-------------- src/actions/action.vala | 2 +- src/actions/actionRegistry.vala | 10 +- src/actions/appAction.vala | 2 +- src/actions/keyAction.vala | 2 +- src/actions/pieAction.vala | 2 +- src/actions/sigAction.vala | 2 +- src/actions/uriAction.vala | 2 +- src/daemon.vala | 6 +- src/gui/aboutWindow.vala | 8 +- src/gui/commandComboList.vala | 2 +- src/gui/iconSelectWindow.vala | 107 ++++------------- src/gui/indicator.vala | 25 +--- src/gui/newSliceWindow.vala | 2 +- src/gui/newsWindow.vala | 4 +- src/gui/pieComboList.vala | 2 +- src/gui/pieList.vala | 2 +- src/gui/pieOptionsWindow.vala | 21 +++- src/gui/piePreview.vala | 5 +- src/gui/piePreviewAddSign.vala | 2 +- src/gui/piePreviewCenter.vala | 2 +- src/gui/piePreviewDeleteSign.vala | 8 +- src/gui/piePreviewRenderer.vala | 2 +- src/gui/piePreviewSliceRenderer.vala | 12 +- src/gui/preferencesWindow.vala | 23 ++-- src/gui/sliceTypeList.vala | 2 +- src/gui/themeList.vala | 2 +- src/gui/tipViewer.vala | 6 +- src/gui/triggerSelectButton.vala | 6 +- src/images/icon.vala | 63 ++++------ src/images/image.vala | 2 +- src/images/renderedText.vala | 2 +- src/images/themedIcon.vala | 2 +- src/pies/defaultConfig.vala | 6 +- src/pies/load.vala | 8 +- src/pies/pie.vala | 2 +- src/pies/pieManager.vala | 2 +- src/pies/save.vala | 2 +- src/renderers/centerRenderer.vala | 7 +- src/renderers/pieRenderer.vala | 84 +++++++------- src/renderers/pieWindow.vala | 145 ++++++++++++++++------- src/renderers/sliceRenderer.vala | 2 +- src/themes/centerLayer.vala | 2 +- src/themes/sliceLayer.vala | 2 +- src/themes/theme.vala | 2 +- src/themes/themeImporter.vala | 2 +- src/utilities/animatedValue.vala | 2 +- src/utilities/archiveReader.vala | 2 +- src/utilities/archiveWriter.vala | 2 +- src/utilities/bindingManager.vala | 16 ++- src/utilities/color.vala | 14 +-- src/utilities/config.vala | 2 +- src/utilities/focusGrabber.vala | 85 ++++++++------ src/utilities/key.vala | 2 +- src/utilities/logger.vala | 28 ++--- src/utilities/paths.vala | 6 +- src/utilities/trigger.vala | 2 +- update_copy_notice.sh | 2 +- 74 files changed, 811 insertions(+), 786 deletions(-) diff --git a/AUTHORS b/AUTHORS index 267bc4d..0d94bad 100644 --- a/AUTHORS +++ b/AUTHORS @@ -4,6 +4,7 @@ Simon Schneegans Gabriel Dubatti Francesco Piccinno György Balló +Tiago de Oliveira Corrêa Translations: diff --git a/CMakeLists.txt b/CMakeLists.txt index c5e5fa5..bc4d457 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,7 @@ find_package(PkgConfig) pkg_check_modules(GTK3 REQUIRED gtk+-3.0) pkg_check_modules(INDICATOR3 appindicator3-0.1) pkg_check_modules(WNCK REQUIRED libwnck-3.0) +pkg_check_modules(BAMF libbamf3) pkg_check_modules(GIO REQUIRED gio-unix-2.0) pkg_check_modules(CAIRO REQUIRED cairo) pkg_check_modules(GEE REQUIRED gee-0.8) @@ -50,12 +51,26 @@ set(CFLAGS -DWNCK_I_KNOW_THIS_IS_UNSTABLE -DGETTEXT_PACKAGE="gnomepie" -s -O3 -w -# -g ) +if (GTK3_VERSION VERSION_LESS 3.20) + message(GTK version ${GTK3_VERSION} is older than 3.20. Some features will not be available.) +else() + LIST(APPEND CFLAGS -DHAVE_GTK_3_20) + LIST(APPEND VALA_DEFINES --define HAVE_GTK_3_20) +endif() + +if (GTK3_VERSION VERSION_LESS 3.22) + message(GTK version ${GTK3_VERSION} is older than 3.22. Some features will not be available.) +else() + LIST(APPEND CFLAGS -DHAVE_GTK_3_22) + LIST(APPEND VALA_DEFINES --define HAVE_GTK_3_22) +endif() + # fallback to gnome-menus2 if gnome-menus3 wasn't found if (${GMENU3_FOUND}) LIST(APPEND CFLAGS -DHAVE_GMENU_3) + LIST(APPEND VALA_DEFINES --define HAVE_GMENU_3) else (${GMENU3_FOUND}) pkg_check_modules(GMENU REQUIRED libgnome-menu) endif (${GMENU3_FOUND}) @@ -63,61 +78,71 @@ endif (${GMENU3_FOUND}) # notify application of presence of libappindicator if (${INDICATOR_FOUND}) LIST(APPEND CFLAGS -DHAVE_APPINDICATOR) + LIST(APPEND VALA_DEFINES --define HAVE_APPINDICATOR) endif (${INDICATOR_FOUND}) if (${INDICATOR3_FOUND}) LIST(APPEND CFLAGS -DHAVE_APPINDICATOR) + LIST(APPEND VALA_DEFINES --define HAVE_APPINDICATOR) endif (${INDICATOR3_FOUND}) +if (${BAMF_FOUND}) + LIST(APPEND CFLAGS -DHAVE_BAMF) + LIST(APPEND VALA_DEFINES --define HAVE_BAMF) +endif (${BAMF_FOUND}) + add_definitions(${CFLAGS}) set(LIBS ${GIO_LIBRARIES} - ${GTK3_LIBRARIES} - ${CAIRO_LIBRARIES} - ${GEE_LIBRARIES} - ${INDICATOR_LIBRARIES} - ${INDICATOR3_LIBRARIES} - ${XML_LIBRARIES} - ${XTST_LIBRARIES} - ${GMENU_LIBRARIES} - ${GMENU3_LIBRARIES} - ${X11_LIBRARIES} - ${WNCK_LIBRARIES} - ${ARCHIVE_LIB} - ${M_LIB} - ${GTHREAD_LIB} + ${GTK3_LIBRARIES} + ${CAIRO_LIBRARIES} + ${GEE_LIBRARIES} + ${INDICATOR_LIBRARIES} + ${INDICATOR3_LIBRARIES} + ${XML_LIBRARIES} + ${XTST_LIBRARIES} + ${GMENU_LIBRARIES} + ${GMENU3_LIBRARIES} + ${X11_LIBRARIES} + ${WNCK_LIBRARIES} + ${BAMF_LIBRARIES} + ${ARCHIVE_LIB} + ${M_LIB} + ${GTHREAD_LIB} ) link_libraries(${LIBS}) set(LIB_PATHS ${GIO_LIBRARY_DIRS} - ${GTK3_LIBRARY_DIRS} - ${CAIRO_LIBRARY_DIRS} - ${GEE_LIBRARY_DIRS} - ${INDICATOR_LIBRARY_DIRS} - ${INDICATOR3_LIBRARY_DIRS} - ${XML_LIBRARY_DIRS} - ${XTST_LIBRARY_DIRS} - ${GMENU_LIBRARY_DIRS} - ${GMENU3_LIBRARY_DIRS} - ${X11_LIBRARY_DIRS} - ${WNCK_LIBRARY_DIRS} + ${GTK3_LIBRARY_DIRS} + ${CAIRO_LIBRARY_DIRS} + ${GEE_LIBRARY_DIRS} + ${INDICATOR_LIBRARY_DIRS} + ${INDICATOR3_LIBRARY_DIRS} + ${XML_LIBRARY_DIRS} + ${XTST_LIBRARY_DIRS} + ${GMENU_LIBRARY_DIRS} + ${GMENU3_LIBRARY_DIRS} + ${X11_LIBRARY_DIRS} + ${WNCK_LIBRARY_DIRS} + ${BAMF_LIBRARY_DIRS} ) link_directories(${LIB_PATHS}) set(INCLUDE_PATHS ${GIO_INCLUDE_DIRS} - ${GTK3_INCLUDE_DIRS} - ${CAIRO_INCLUDE_DIRS} - ${GEE_INCLUDE_DIRS} - ${INDICATOR_INCLUDE_DIRS} - ${INDICATOR3_INCLUDE_DIRS} - ${XML_INCLUDE_DIRS} - ${XTST_INCLUDE_DIRS} - ${GMENU_INCLUDE_DIRS} - ${GMENU3_INCLUDE_DIRS} - ${X11_INCLUDE_DIRS} - ${WNCK_INCLUDE_DIRS} + ${GTK3_INCLUDE_DIRS} + ${CAIRO_INCLUDE_DIRS} + ${GEE_INCLUDE_DIRS} + ${INDICATOR_INCLUDE_DIRS} + ${INDICATOR3_INCLUDE_DIRS} + ${XML_INCLUDE_DIRS} + ${XTST_INCLUDE_DIRS} + ${GMENU_INCLUDE_DIRS} + ${GMENU3_INCLUDE_DIRS} + ${X11_INCLUDE_DIRS} + ${WNCK_INCLUDE_DIRS} + ${BAMF_INCLUDE_DIRS} ) include_directories(${INCLUDE_PATHS}) @@ -128,17 +153,17 @@ include_directories(${INCLUDE_PATHS}) set(EXECUTABLE_OUTPUT_PATH ${gnomepie_SOURCE_DIR}) set(VALA_PKGS - gtk+-3.0 - gdk-x11-3.0 - libwnck-3.0 - cairo - gee-0.8 - x11 - gio-unix-2.0 - posix - libxml-2.0 - xtst - libarchive + gtk+-3.0 + gdk-x11-3.0 + libwnck-3.0 + cairo + gee-0.8 + x11 + gio-unix-2.0 + posix + libxml-2.0 + xtst + libarchive ) if (${INDICATOR_FOUND}) @@ -155,6 +180,10 @@ else (${GMENU3_FOUND}) LIST(APPEND VALA_PKGS libgnome-menu) endif (${GMENU3_FOUND}) +if (${BAMF_FOUND}) + LIST(APPEND VALA_PKGS libbamf3) +endif (${BAMF_FOUND}) + add_subdirectory(src) ################################################################ diff --git a/README.md b/README.md index 1adb8ed..3642d5a 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ If you can’t afford the time to do the stuff mentioned above, but still want t ## License -Copyright (C) 2011-2016 Simon Schneegans +Copyright (C) 2011-2017 Simon Schneegans This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/resources/locale/ru/LC_MESSAGES/ru.po b/resources/locale/ru/LC_MESSAGES/ru.po index b023a05..81f0fd9 100644 --- a/resources/locale/ru/LC_MESSAGES/ru.po +++ b/resources/locale/ru/LC_MESSAGES/ru.po @@ -12,13 +12,13 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2012-01-14 08:15-0500\n" -"Last-Translator: Eugene Roskin \n" +"PO-Revision-Date: 2017-03-29 09:50+0500\n" +"Last-Translator: ashed craysy@gmail.com\n" "Language-Team: Russian\n" "Language: ru\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " -"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -"X-Generator: Zanata 3.7.3\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Poedit 1.5.4\n" #: ../ui/pie_options.ui:53 msgid "Activation Settings" @@ -26,7 +26,7 @@ msgstr "Настройки активации" #: ../ui/pie_options.ui:153 msgid "Unamed Pie" -msgstr "" +msgstr "Безымянный пай" #: ../ui/pie_options.ui:216 msgid "ID:" @@ -43,7 +43,7 @@ msgstr "Турбо-режим" #: ../ui/pie_options.ui:280 ../ui/pie_options.ui:281 msgid "If checked, the Pie will close when you release the chosen hot key." msgstr "" -"Если выбрана эта возможность, пай закроется после того, как вы отпустите " +"Если выбрана эта возможность, пай закроется после того, как вы отпустите " "клавиши быстрого доступа" #: ../ui/pie_options.ui:293 @@ -62,56 +62,55 @@ msgid "Open Pie centered on the screen" msgstr "Открыть пай по центру экрана" #: ../ui/pie_options.ui:318 ../ui/pie_options.ui:319 -#, fuzzy msgid "" "If checked, the Pie will open in the middle of your screen. Else it will pop " "up at your pointer." msgstr "" -"Если выбрана эта возможность, пай откроется в центре вашего экрана.А также " +"Если выбрана эта возможность, пай откроется в центре вашего экрана. А также " "может открываться чуть выше вашего курсора." #: ../ui/pie_options.ui:331 msgid "Warp mouse pointer to center of Pie" -msgstr "" +msgstr "Деформировать указатель мыши к центру Пая" #: ../ui/pie_options.ui:337 ../ui/pie_options.ui:338 msgid "" "If checked, the mouse pointer will be warped to the center of the Pie. This " "allows for quick selections even if the Pie is opened at the screen's " "boundary." -msgstr "" +msgstr "Если отмечено" #: ../ui/pie_options.ui:356 -#, fuzzy msgid "Activation options" -msgstr "Параметры активации" +msgstr "Параметры активации" #: ../ui/pie_options.ui:547 msgid "Automatically select the best pie shape" -msgstr "" +msgstr "Автоматически выбирать лучшую форму пая" #: ../ui/pie_options.ui:551 msgid "" "If checked, the shape will be automatically selected to minimize mouse " "travelling." msgstr "" +"Если отмечено, форма будет автоматически выбрана для минимизации перемещения " +"мыши." #: ../ui/pie_options.ui:571 msgid "Pie shape" -msgstr "" +msgstr "Форма пая" #: ../ui/slice_select.ui:8 -#, fuzzy msgid "Slice Options" -msgstr "Параметры порции" +msgstr "Параметры Фрагмента" #: ../ui/slice_select.ui:140 msgid "There are no options for this Slice type." -msgstr "Отсутствуют параметры для этого типа порции" +msgstr "Отсутствуют параметры для этого типа фрагмента" #: ../ui/slice_select.ui:166 msgid "Name of the Slice " -msgstr "Название порции" +msgstr "Название фрагмента" #: ../ui/slice_select.ui:204 msgid "URI to open" @@ -119,7 +118,7 @@ msgstr "URI для открытия" #: ../ui/slice_select.ui:242 msgid "Command to execute" -msgstr "Командая для выполнения" +msgstr "Команда для выполнения" #: ../ui/slice_select.ui:280 msgid "Hotkey to press" @@ -135,12 +134,11 @@ msgstr "Это быстрое действие" #: ../ui/slice_select.ui:353 ../ui/slice_select.ui:354 msgid "This Slice will be executed when you click in the middle of the Pie." -msgstr "Эта порция будет выполнена, после нажатия в центре пая" +msgstr "Эта фрагмент будет выполнен, после нажатия в центре пая" #: ../ui/slice_select.ui:386 -#, fuzzy msgid "Slice options" -msgstr "Параметры порции" +msgstr "Параметры фрагмента" #: ../ui/icon_select.ui:9 msgid "Select an icon" @@ -155,17 +153,14 @@ msgid "Custom Icon" msgstr "Настроить значок" #: ../ui/preferences.ui:7 ../../src/gui/preferencesWindow.vala:78 -#, fuzzy msgid "Gnome-Pie Settings" msgstr "Настройки Gnome-Pie" #: ../ui/preferences.ui:41 -#, fuzzy msgid "Start Gnome-Pie on login" msgstr "Запускать Gnome-Pie при загрузке системы" #: ../ui/preferences.ui:47 ../ui/preferences.ui:48 -#, fuzzy msgid "If checked, Gnome-Pie will start silently everytime you log in." msgstr "" "Если выбрана эта возможность, Gnome-Pie будет фоново запускаться после входа " @@ -185,7 +180,7 @@ msgstr "" #: ../ui/preferences.ui:79 msgid "Select Slices by typing their names" -msgstr "" +msgstr "Выберите фрагменты, введя их имена" #: ../ui/preferences.ui:85 ../ui/preferences.ui:86 msgid "" @@ -193,9 +188,11 @@ msgid "" "you can activate them with a hotkey (which can be displayed by pressing ALT " "when a Pie is openened)." msgstr "" +"Если отмечено, вы можете выбрать элементы в Пае, введя их имена. Иначе вы " +"можете активировать их горячей клавишей (которая может отображаться при " +"нажатии клавиши ALT при открытии Пая)." #: ../ui/preferences.ui:98 -#, fuzzy msgid "Display Slice labels" msgstr "Показывать значок на панели " @@ -204,38 +201,38 @@ msgid "" "Displays the name of each Slice next to it. Only available if supported by " "the theme." msgstr "" +"Отображать имя каждого фрагмента рядом с ним. Доступно только если " +"поддерживается темой." #: ../ui/preferences.ui:139 msgid "Activation radius" -msgstr "" +msgstr "Радиус активации" #: ../ui/preferences.ui:179 -#, fuzzy msgid "Global scale" msgstr "Общий масштаб" #: ../ui/preferences.ui:219 msgid "Maximum slices per pie" -msgstr "" +msgstr "Максимум фрагментов на Пай" #: ../ui/preferences.ui:302 msgid "Import a theme from a file." -msgstr "" +msgstr "Импорт темы из файла." #: ../ui/preferences.ui:323 msgid "Delete the selected theme." -msgstr "" +msgstr "Удалить выделенную тему." #: ../ui/preferences.ui:344 msgid "Export the selected theme for sharing." -msgstr "" +msgstr "Поделиться выделенной темой." #: ../ui/preferences.ui:392 msgid "Open a tutorial on how to create new themes for Gnome-Pie." -msgstr "" +msgstr "Открыть учебник о создании новых тем для Gnome-Pie." #: ../ui/preferences.ui:442 ../../src/gui/preferencesWindow.vala:109 -#, fuzzy msgid "General Settings" msgstr "Основные настройки" @@ -249,6 +246,14 @@ msgid "" "\n" "For manual and advanced configuration click on the plus sign." msgstr "" +"Этот Пай пуст!\n" +"\n" +"Начните добавлять фрагменты! Это можно сделать, перетащив что-либо на " +"знак плюса ниже. Вы можете попробовать много всякого! Например, ярлыки " +"запуска приложений или папки приложений. Даже URL-адреса из вашего " +"браузера...\n" +"\n" +"Для ручной и расширенной конфигурации нажмите на знак плюса." #: ../ui/preferences.ui:655 msgid "" @@ -257,14 +262,14 @@ msgid "" "Start by creating one! This can be done by clicking on the tiny little " "plus sign in the lower left corner." msgstr "" -"Отсутствуют паи!\n" +"Отсутствуют паи!\n" "\n" -"Начните с создания пая! Выполните это щёлкнув на небольшом значке " +"Начните с создания пая! Выполните это щёлкнув на небольшом значке " "плюсав нижнем левом углу." #: ../ui/preferences.ui:741 ../../src/gui/preferencesWindow.vala:110 msgid "Pie Settings" -msgstr "" +msgstr "Настройки Пая" #: ../../src/actions/keyAction.vala:34 msgid "Press hotkey" @@ -276,13 +281,11 @@ msgstr "Имитирует активацию сочетания клавиш б #: ../../src/actions/uriAction.vala:34 msgid "Open URI" -msgstr "Открытие URI" +msgstr "Открыть URI" #: ../../src/actions/uriAction.vala:36 msgid "Opens a given location. You may use URL's or files paths." -msgstr "" -"Открывает заданный адрес. Вы можете использовать адресные ссылки или адреса " -"файлов." +msgstr "Открыть заданный адрес. Можно использовать URL или пути к файлам." #: ../../src/actions/actionRegistry.vala:119 msgid "Trash" @@ -294,131 +297,145 @@ msgstr "Запустить приложение" #: ../../src/actions/appAction.vala:36 msgid "Executes the given command." -msgstr "Выполняет заданную команду." +msgstr "Выполнить заданную команду." #: ../../src/actions/pieAction.vala:34 msgid "Open Pie" -msgstr "Открытие пая" +msgstr "Открыть пай" #: ../../src/actions/pieAction.vala:36 msgid "Opens another Pie of Gnome-Pie. You may create sub menus this way." -msgstr "" -"Oткрывает ещё один пай Gnome-Pie. Таким образом вы можете создавать подменю." +msgstr "Открыть ещё один пай Gnome-Pie. Таким образом можно создать подменю." #: ../../src/gui/preferencesWindow.vala:79 msgid "bake your pies!" -msgstr "" +msgstr "выпекайте паи!" #: ../../src/gui/preferencesWindow.vala:235 msgid "Pies can be opened with the terminal command \"gnome-pie --open=ID\"." -msgstr "" +msgstr "Паи можно открыть с помощью команды терминала \"gnome-pie --open=ID\"." #: ../../src/gui/preferencesWindow.vala:236 msgid "Feel free to visit Gnome-Pie's homepage at %s!" -msgstr "" +msgstr "Посетите страницу Gnome-Pie %s!" #: ../../src/gui/preferencesWindow.vala:237 msgid "If you want to give some feedback, please write an e-mail to %s!" -msgstr "" +msgstr "Если вы хотите дать обратную связь, напишите письмо по адресу %s!" #: ../../src/gui/preferencesWindow.vala:238 msgid "You can support the development of Gnome-Pie by donating via %s." -msgstr "" +msgstr "Вы можете поддержать развитие Gnome-Pie, пожертвовав через %s." #: ../../src/gui/preferencesWindow.vala:239 msgid "" "Translating Gnome-Pie to your language is easy. Translations are managed at " "%s." -msgstr "" +msgstr "Перевод Gnome-Пая на ваш язык легок. Переводы управляются на %s." #: ../../src/gui/preferencesWindow.vala:240 msgid "" "It's easy to create new themes for Gnome-Pie. Read the Tutorial online." msgstr "" +"Легко создавать новые темы для Gnome-Pie. Прочтите Учебник " +"онлайн." #: ../../src/gui/preferencesWindow.vala:241 msgid "It's usually a good practice to have at most twelve slices per pie." msgstr "" +"Обычно хорошая практика состоит в том, чтобы иметь не более двенадцати " +"фрагментов на Пай." #: ../../src/gui/preferencesWindow.vala:242 msgid "You can export themes you created and share them with the community!" -msgstr "" +msgstr "Вы можете экспортировать созданные темы и делиться ими с сообществом!" #: ../../src/gui/preferencesWindow.vala:243 msgid "The source code of Gnome-Pie is available on %s." -msgstr "" +msgstr "Исходный код Gnome-Pie доступен на %s." #: ../../src/gui/preferencesWindow.vala:244 msgid "Bugs can be reported at %s!" -msgstr "" +msgstr "Об ошибках можно сообщить по адресу %s!" #: ../../src/gui/preferencesWindow.vala:245 msgid "Suggestions can be posted on %s!" -msgstr "" +msgstr "Предложения можно размещать на %s!" #: ../../src/gui/preferencesWindow.vala:246 msgid "" "An awesome companion of Gnome-Pie is %s. It will make using your computer " "feel like magic!" msgstr "" +"Удивительный спутник Gnome-Pie - это %s. Сделайте использование вашего " +"компьютера волшебным!" #: ../../src/gui/preferencesWindow.vala:247 msgid "You can drag'n'drop applications from your main menu to the pie above." msgstr "" +"Вы можете перетащить приложения из своего главного меню в указанный выше Пай." #: ../../src/gui/preferencesWindow.vala:248 msgid "" "You may drag'n'drop URLs and bookmarks from your internet browser to the pie " "above." msgstr "" +"Вы можете перетащить URL-адреса и закладки из своего интернет-браузера в " +"указанный выше Пай." #: ../../src/gui/preferencesWindow.vala:249 msgid "" "You can drag'n'drop files and folders from your file browser to the pie " "above." msgstr "" +"Вы можете перетащить файлы и папки из браузера файлов в указанный выше Пай." #: ../../src/gui/preferencesWindow.vala:250 msgid "" "You can drag'n'drop pies from the list on the left into other pies in order " "to create sub-pies." msgstr "" +"Вы можете перетаскивать Паи из списка слева в другие Паи, чтобы создать " +"субПаи." #: ../../src/gui/preferencesWindow.vala:251 msgid "" "You can drag'n'drop pies from the list on the left to your desktop or dock " "to create a launcher for this pie." msgstr "" +"Вы можете перетаскивать Паи из списка слева на свой рабочий стол или док, " +"чтобы создать ярлык запуска для этого Пая." #: ../../src/gui/preferencesWindow.vala:401 msgid "Sucessfully imported new theme!" -msgstr "" +msgstr "Успешно импортирована новая тема!" #: ../../src/gui/preferencesWindow.vala:415 msgid "An error occured while importing the theme: Failed to extract theme!" -msgstr "" +msgstr "При импорте темы произошла ошибка: Не удалось извлечь тему!" #: ../../src/gui/preferencesWindow.vala:419 msgid "" "An error occured while importing the theme: A theme with this name does " "already exist!" -msgstr "" +msgstr "При импорте темы произошла ошибка: тема с этим именем уже существует!" #: ../../src/gui/preferencesWindow.vala:423 msgid "" "An error occured while importing the theme: Theme archive does not contain a " "valid theme!" msgstr "" +"При импорте темы произошла ошибка: в архиве темы нет действительной темы!" #: ../../src/gui/preferencesWindow.vala:427 msgid "" "An error occured while importing the theme: Failed to open theme archive!" -msgstr "" +msgstr "При импорте темы произошла ошибка: Не удалось открыть тему!" #: ../../src/gui/preferencesWindow.vala:451 msgid "Do you really want to delete the selected theme from %s?" -msgstr "" +msgstr "Вы действительно хотите удалить выбранную тему из %s?" #: ../../src/gui/preferencesWindow.vala:528 msgid "New Pie" @@ -429,48 +446,44 @@ msgid "" "Do you really want to delete the selected Pie with all contained Slices?" msgstr "" "Вы действительно хотите удалить выделенный пай, со всеми содержащимися в нём " -"порциями?" +"фрагментами?" #: ../../src/gui/piePreview.vala:148 -#, fuzzy msgid "Do you really want to delete this Slice?" -msgstr "Вы действительно хотите удалить эту порцию?" +msgstr "Вы действительно хотите удалить этот фрагмент?" #: ../../src/gui/sliceTypeList.vala:60 -#, fuzzy msgid "Slice types" -msgstr "Типы порций" +msgstr "Типы фрагментов" #: ../../src/gui/piePreviewRenderer.vala:419 msgid "Click to edit" -msgstr "Щёлкните для выполнения изменений" +msgstr "Щелчок для правки" #: ../../src/gui/piePreviewRenderer.vala:419 #: ../../src/gui/piePreviewRenderer.vala:434 msgid "Drag to move" -msgstr "Перетаскивайте для выполнения перемещения" +msgstr "Перемещайте таская" #: ../../src/gui/piePreviewRenderer.vala:422 -#, fuzzy msgid "Click to add a new Slice" -msgstr "Щёлкните для добавления новой порции" +msgstr "Щелчок - доб-ть нов. фрагмент" #: ../../src/gui/piePreviewRenderer.vala:426 -#, fuzzy msgid "Drop to add as new Slice" -msgstr "Перетаскивайте для выполнения добавления в качастве новой порции" +msgstr "Перетащить - добавить как новый фрагмент" #: ../../src/gui/piePreviewRenderer.vala:429 msgid "Drop to move Slice" -msgstr "Перетаскивайте для выполнения перемещения порции" +msgstr "Перетащить - переместить фрагмент" #: ../../src/gui/piePreviewRenderer.vala:434 msgid "Click to delete" -msgstr "Щёлкните для выполнения удаления" +msgstr "Щелчок - удалить" #: ../../src/gui/pieList.vala:77 msgid "Pies" -msgstr "" +msgstr "Паи" #: ../../src/gui/iconSelectWindow.vala:182 msgid "All icons" @@ -499,7 +512,7 @@ msgstr "Эмоции" #: ../../src/gui/iconSelectWindow.vala:188 msgid "Miscellaneous" -msgstr "Дополнительно" +msgstr "Прочее" #: ../../src/gui/iconSelectWindow.vala:261 msgid "All supported image formats" @@ -517,7 +530,7 @@ msgid "" msgstr "" "Эта клавиша быстрого доступа уже назначена паю \"%s\"! \n" "\n" -"Пожалуйста, выберите другую или выполните отмену выбора." +"Пожалуйста, выберите другую или отмените выбор." #: ../../src/gui/themeList.vala:59 msgid "Themes" @@ -525,28 +538,27 @@ msgstr "Темы" #: ../../src/gui/themeList.vala:108 msgid "by" -msgstr "" +msgstr "от" #: ../../src/gui/indicator.vala:126 msgid "_Preferences" -msgstr "" +msgstr "Настройки" #: ../../src/gui/indicator.vala:135 msgid "_About" -msgstr "" +msgstr "О программе" #: ../../src/gui/indicator.vala:150 msgid "_Quit" -msgstr "" +msgstr "Выход" #: ../../src/gui/newsWindow.vala:64 msgid "_Close" -msgstr "" +msgstr "Закрыть" #: ../../src/gui/triggerSelectButton.vala:64 -#, fuzzy msgid "Press a hotkey ..." -msgstr "Нажмите сочетание клавиш быстрого доступа" +msgstr "Нажмите горячие клавиши" #: ../../src/utilities/key.vala:65 ../../src/utilities/bindingManager.vala:186 #: ../../src/utilities/trigger.vala:195 ../../src/utilities/trigger.vala:280 @@ -584,42 +596,40 @@ msgstr "По центру" #: ../../src/utilities/trigger.vala:232 ../../src/utilities/trigger.vala:234 msgid "Warp" -msgstr "" +msgstr "Деформация" #: ../../src/utilities/trigger.vala:238 ../../src/utilities/trigger.vala:240 msgid "Auto-shaped" -msgstr "" +msgstr "Автоформа" #: ../../src/utilities/trigger.vala:243 ../../src/utilities/trigger.vala:245 msgid "Quarter pie" -msgstr "" +msgstr "Четверть Пая" #: ../../src/utilities/trigger.vala:249 ../../src/utilities/trigger.vala:251 msgid "Half pie" -msgstr "" +msgstr "Половина Пая" #: ../../src/themes/theme.vala:169 msgid "Successfully exported the theme \"%s\"!" -msgstr "" +msgstr "Тема экспортирована успешно \"%s\"!" #: ../../src/themes/theme.vala:176 msgid "" "An error occured while exporting the theme \"%s\"! Please check the console " "output." -msgstr "" +msgstr "При экспорте темы произошла ошибка \"%s\"! Проверьте вывод консоли." #: ../../src/actionGroups/windowListGroup.vala:34 -#, fuzzy msgid "Group: Window List" msgstr "Группа: Список окон" #: ../../src/actionGroups/windowListGroup.vala:36 msgid "Shows a Slice for each of your opened Windows. Almost like Alt-Tab." msgstr "" -"Показывает порцию для каждого из открытых окон. Как это делает Alt-Tab." +"Показать фрагмент для каждого из открытых окон. Как это делает Alt-Tab." #: ../../src/actionGroups/clipboardGroup.vala:64 -#, fuzzy msgid "Group: Clipboard" msgstr "Группа: Буфер обмена" @@ -628,20 +638,18 @@ msgid "Manages your Clipboard." msgstr "Управляет вашим буфером обмена." #: ../../src/actionGroups/devicesGroup.vala:35 -#, fuzzy msgid "Group: Devices" msgstr "Группа: Устройства" #: ../../src/actionGroups/devicesGroup.vala:37 msgid "Shows a Slice for each plugged in devices, like USB-Sticks." -msgstr "Показывает порцию подключённых устройств, например USB-накопителя." +msgstr "Показать фрагмент для подключённых устройств, например USB-накопителя." #: ../../src/actionGroups/devicesGroup.vala:85 msgid "Root" msgstr "Файловая система" #: ../../src/actionGroups/menuGroup.vala:35 -#, fuzzy msgid "Group: Main menu" msgstr "Группа: Основное меню" @@ -651,22 +659,23 @@ msgstr "Отображает структуру вашего основного #: ../../src/actionGroups/workspaceWindowListGroup.vala:35 msgid "Group: Window List for current workspace" -msgstr "" +msgstr "Группа: Список окон для текущего рабочего пространства" #: ../../src/actionGroups/workspaceWindowListGroup.vala:37 msgid "" "Shows a Slice for each of your opened windows on the current workspace." msgstr "" +"Показать фрагмент для каждого из открытых окон в текущем рабочем " +"пространстве." #: ../../src/actionGroups/sessionGroup.vala:35 -#, fuzzy msgid "Group: Session Control" msgstr "Группа: Управление сеансом" #: ../../src/actionGroups/sessionGroup.vala:37 msgid "Shows a Slice for Shutdown, Reboot, and Hibernate." msgstr "" -"Показывает порцию для операций выключения, перезагрузки и спящего режима." +"Показывает фрагмент для операций выключения, перезагрузки и спящего режима." #: ../../src/actionGroups/sessionGroup.vala:60 msgid "Shutdown" @@ -681,13 +690,12 @@ msgid "Reboot" msgstr "Перезагрузить" #: ../../src/actionGroups/bookmarkGroup.vala:36 -#, fuzzy msgid "Group: Bookmarks" msgstr "Группа: Закладки" #: ../../src/actionGroups/bookmarkGroup.vala:38 msgid "Shows a Slice for each of your directory Bookmarks." -msgstr "Показывает порцию содержащую закладки папок." +msgstr "Показать фрагмент, содержащий закладки папок." #: ../../src/pies/defaultConfig.vala:29 msgid "Multimedia" diff --git a/resources/ui/icon_select.ui b/resources/ui/icon_select.ui index 6870f53..f9a7ee2 100644 --- a/resources/ui/icon_select.ui +++ b/resources/ui/icon_select.ui @@ -1,5 +1,5 @@ - + @@ -40,20 +40,6 @@ True False 6 - - - True - False - - - - - - False - True - 0 - - True @@ -157,7 +143,6 @@ gtk-cancel - False True True True @@ -172,7 +157,6 @@ gtk-ok - False True True True diff --git a/resources/ui/pie_options.ui b/resources/ui/pie_options.ui index 0e0820b..883e0ea 100644 --- a/resources/ui/pie_options.ui +++ b/resources/ui/pie_options.ui @@ -1,5 +1,5 @@ - + @@ -70,7 +70,6 @@ gtk-cancel - False True True True @@ -86,7 +85,6 @@ gtk-ok - False True True True @@ -118,11 +116,10 @@ False - False True True - True False + True True @@ -180,20 +177,6 @@ 1 - - - True - False - False - 0 - 0.11999999731779099 - - - False - False - 2 - - False @@ -211,8 +194,8 @@ True False False + start True - 0 ID: middle @@ -227,10 +210,10 @@ - + True False - 1 + end It's possible to bind mouse buttons as well! @@ -251,7 +234,7 @@ - + True False 0 @@ -272,14 +255,13 @@ Turbo mode - False True True False True If checked, the Pie will close when you release the chosen hot key. If checked, the Pie will close when you release the chosen hot key. - 0 + start True @@ -291,14 +273,13 @@ Long press for activation - False True True False True If checked, the Pie will only open if you press this hot key a bit longer. If checked, the Pie will only open if you press this hot key a bit longer. - 0 + start True @@ -310,14 +291,13 @@ Open Pie centered on the screen - False True True False True If checked, the Pie will open in the middle of your screen. Else it will pop up at your pointer. If checked, the Pie will open in the middle of your screen. Else it will pop up at your pointer. - 0 + start True @@ -329,14 +309,13 @@ Warp mouse pointer to center of Pie - False True True False True If checked, the mouse pointer will be warped to the center of the Pie. This allows for quick selections even if the Pie is opened at the screen's boundary. If checked, the mouse pointer will be warped to the center of the Pie. This allows for quick selections even if the Pie is opened at the screen's boundary. - 0 + start True @@ -398,7 +377,6 @@ True False shape1 - 0 True True @@ -413,7 +391,6 @@ True False shape2 - 0 True True rshape1 @@ -429,7 +406,6 @@ True False shape3 - 0 True True rshape1 @@ -445,7 +421,6 @@ True False shape4 - 0 True True rshape1 @@ -461,7 +436,6 @@ True False shape5 - 0 True True rshape1 @@ -477,7 +451,6 @@ True False shape6 - 0 True True rshape1 @@ -493,7 +466,6 @@ True False shape7 - 0 True True rshape1 @@ -509,7 +481,6 @@ True False shape8 - 0 True True rshape1 @@ -525,7 +496,6 @@ True False shape9 - 0 True True rshape1 @@ -549,7 +519,6 @@ True False If checked, the shape will be automatically selected to minimize mouse travelling. - 0 True True rshape1 diff --git a/resources/ui/preferences.ui b/resources/ui/preferences.ui index 8f9eebc..2c15fea 100644 --- a/resources/ui/preferences.ui +++ b/resources/ui/preferences.ui @@ -1,5 +1,5 @@ - + @@ -39,14 +39,13 @@ Start Gnome-Pie on login - False True True False True If checked, Gnome-Pie will start silently everytime you log in. If checked, Gnome-Pie will start silently everytime you log in. - 0 + start True @@ -58,14 +57,13 @@ Display panel icon - False True True False True If not checked, you can access this menu by launching Gnome-Pie a second time. If not checked, you can access this menu by launching Gnome-Pie a second time. - 0 + start True @@ -77,14 +75,13 @@ Select Slices by typing their names - False True True False True If checked, you can select items in a Pie by typing their names. Otherwise you can activate them with a hotkey (which can be displayed by pressing ALT when a Pie is openened). If checked, you can select items in a Pie by typing their names. Otherwise you can activate them with a hotkey (which can be displayed by pressing ALT when a Pie is openened). - 0 + start True @@ -96,14 +93,13 @@ Display Slice labels - False True True False True Displays the name of each Slice next to it. Only available if supported by the theme. Displays the name of each Slice next to it. Only available if supported by the theme. - 0 + start True @@ -725,13 +721,14 @@ True False - 2 vertical False - 6 - 6 + 6 + 6 + 6 + 6 <b><big>This Pie is empty!</big> Start adding Slices to it!</b> This can be done by dragging stuff to the plus sign below. You can try a lot! For example application launchers or folders. Even URLs from your browser are possible... @@ -751,8 +748,10 @@ For manual and advanced configuration click on the plus sign. False - 6 - 6 + 6 + 6 + 6 + 6 <b><big>You have no Pies!</big> Start by creating one! </b> This can be done by clicking on the tiny little plus sign in the lower left corner. @@ -775,6 +774,9 @@ Start by creating one! </b> This can be done by clicking on the tiny littl + True @@ -801,6 +803,9 @@ Start by creating one! </b> This can be done by clicking on the tiny littl 3 + diff --git a/resources/ui/slice_select.ui b/resources/ui/slice_select.ui index 6db2adf..10672dd 100644 --- a/resources/ui/slice_select.ui +++ b/resources/ui/slice_select.ui @@ -1,5 +1,5 @@ - + @@ -24,7 +24,6 @@ gtk-close - False True True True @@ -39,7 +38,6 @@ gtk-ok - False True True True @@ -102,7 +100,6 @@ 6 - False True True True @@ -138,7 +135,6 @@ True False There are no options for this Slice type. - 0 True @@ -163,8 +159,8 @@ True False + start URI to open - 0 True @@ -201,8 +197,8 @@ True False + start Command to execute - 0 True @@ -230,8 +226,8 @@ True False + start Hotkey to press - 0 True @@ -259,8 +255,8 @@ True False + start Pie to open - 0 True @@ -288,8 +284,8 @@ True False + start Name of the Slice - 0 True @@ -326,8 +322,8 @@ True False + start Is Quick Action - 0 True @@ -365,8 +361,8 @@ True False + start Clipboard history length - 0 True @@ -405,8 +401,8 @@ True False + start Current workspace only - 0 True diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4d1194f..fcbe1e9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,17 +5,6 @@ # determine source and header files file(GLOB VALA_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.vala */*.vala) -if (${INDICATOR_FOUND}) - LIST(APPEND DEFINES --define HAVE_APPINDICATOR) -endif(${INDICATOR_FOUND}) -if (${INDICATOR3_FOUND}) - LIST(APPEND DEFINES --define HAVE_APPINDICATOR) -endif(${INDICATOR3_FOUND}) - -if (${GMENU3_FOUND}) - LIST(APPEND DEFINES --define HAVE_GMENU_3) -endif (${GMENU3_FOUND}) - # use valac to compile sources to c files vala_precompile( VALA_C @@ -24,7 +13,7 @@ vala_precompile( ${VALA_PKGS} OPTIONS --thread - ${DEFINES} + ${VALA_DEFINES} ) # compile c-sources diff --git a/src/actionGroups/actionGroup.vala b/src/actionGroups/actionGroup.vala index 3bc7086..cb3f125 100644 --- a/src/actionGroups/actionGroup.vala +++ b/src/actionGroups/actionGroup.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/actionGroups/bookmarkGroup.vala b/src/actionGroups/bookmarkGroup.vala index 3a36be6..dc859fa 100644 --- a/src/actionGroups/bookmarkGroup.vala +++ b/src/actionGroups/bookmarkGroup.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -41,12 +41,10 @@ public class BookmarkGroup : ActionGroup { } ///////////////////////////////////////////////////////////////////// - /// Two members needed to avoid useless, frequent changes of the - /// stored Actions. + /// Used to track changes in the bookmarks file. ///////////////////////////////////////////////////////////////////// - private bool changing = false; - private bool changed_again = false; + private GLib.FileMonitor monitor = null; ///////////////////////////////////////////////////////////////////// /// C'tor, initializes all members. @@ -65,20 +63,43 @@ public class BookmarkGroup : ActionGroup { construct { this.load(); - // add monitor - var bookmark_file = GLib.File.new_for_path( - GLib.Environment.get_home_dir()).get_child(".gtk-bookmarks"); + var bookmarks_file = get_bookmarks_file(); - if (bookmark_file.query_exists()) { + // add monitor + if (bookmarks_file != null) { try { - var monitor = bookmark_file.monitor(GLib.FileMonitorFlags.NONE); - monitor.changed.connect(this.reload); + this.monitor = bookmarks_file.monitor(GLib.FileMonitorFlags.NONE); + this.monitor.set_rate_limit(500); + this.monitor.changed.connect((file, other, type) => { + if(type == GLib.FileMonitorEvent.CHANGES_DONE_HINT) { + this.delete_all(); + this.load(); + } + }); } catch (GLib.Error e) { warning(e.message); } } } + ///////////////////////////////////////////////////////////////////// + /// Returns either ~/.gtk-bookmarks or ~/.config/gtk-3.0/bookmarks + ///////////////////////////////////////////////////////////////////// + + private GLib.File? get_bookmarks_file() { + var bookmarks_file = GLib.File.new_for_path( + GLib.Environment.get_home_dir()).get_child(".gtk-bookmarks"); + + if (bookmarks_file.query_exists()) return bookmarks_file; + + bookmarks_file = GLib.File.new_for_path( + GLib.Environment.get_home_dir()).get_child(".config/gtk-3.0/bookmarks"); + + if (bookmarks_file.query_exists()) return bookmarks_file; + + return null; + } + ///////////////////////////////////////////////////////////////////// /// Adds Actions for each gtk-bookmark of the user and for his home /// folder, desktop and trash. @@ -88,23 +109,27 @@ public class BookmarkGroup : ActionGroup { // add home folder this.add_action(ActionRegistry.new_for_uri("file://" + GLib.Environment.get_home_dir())); - // add .gtk-bookmarks - var bookmark_file = GLib.File.new_for_path( - GLib.Environment.get_home_dir()).get_child(".gtk-bookmarks"); + // add bookmarks + var bookmarks_file = get_bookmarks_file(); - if (!bookmark_file.query_exists()) { - warning("Failed to find file \".gtk-bookmarks\"!"); + if (bookmarks_file == null) { + warning("Failed to find bookmarks file!"); return; } try { - var dis = new DataInputStream(bookmark_file.read()); + var dis = new DataInputStream(bookmarks_file.read()); string line; while ((line = dis.read_line(null)) != null) { - var parts = line.split(" "); - string uri = parts[0]; - string name = parts[1]; + string uri = line; + string name = null; + + int first_space = line.index_of(" "); + if (first_space > 0) { + uri = line.slice(0, first_space); + name = line.slice(first_space+1, line.length); + } this.add_action(ActionRegistry.new_for_uri(uri, name)); } @@ -118,34 +143,6 @@ public class BookmarkGroup : ActionGroup { // add desktop this.add_action(ActionRegistry.new_for_uri("file://" + GLib.Environment.get_user_special_dir(GLib.UserDirectory.DESKTOP))); } - - ///////////////////////////////////////////////////////////////////// - /// Reloads all Bookmarks. Is called when the user's gtk-bookmarks - /// file changes. - ///////////////////////////////////////////////////////////////////// - - private void reload() { - // avoid too frequent changes... - if (!this.changing) { - this.changing = true; - Timeout.add(200, () => { - if (this.changed_again) { - this.changed_again = false; - return true; - } - - // reload - message("Bookmarks changed..."); - this.delete_all(); - this.load(); - - this.changing = false; - return false; - }); - } else { - this.changed_again = true; - } - } } } diff --git a/src/actionGroups/clipboardGroup.vala b/src/actionGroups/clipboardGroup.vala index 51c3d1a..63bb093 100644 --- a/src/actionGroups/clipboardGroup.vala +++ b/src/actionGroups/clipboardGroup.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -53,7 +53,7 @@ public class ClipboardGroup : ActionGroup { if (file.query_exists()) { try { var info = file.query_info("standard::icon", 0); - this.icon = Icon.get_icon_name(info.get_icon()); + this.icon = info.get_icon().to_string(); } catch (Error e) { warning("Failed to generate icon for ClipboardGroupItem."); } diff --git a/src/actionGroups/devicesGroup.vala b/src/actionGroups/devicesGroup.vala index 1ea8607..a9164f5 100644 --- a/src/actionGroups/devicesGroup.vala +++ b/src/actionGroups/devicesGroup.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -89,7 +89,8 @@ public class DevicesGroup : ActionGroup { // get icon var icon = mount.get_icon(); - this.add_action(new UriAction(mount.get_name(), Icon.get_icon_name(icon), mount.get_root().get_uri())); + this.add_action(new UriAction(mount.get_name(), + icon.to_string(), mount.get_root().get_uri())); } } diff --git a/src/actionGroups/groupRegistry.vala b/src/actionGroups/groupRegistry.vala index 89cde6a..eaaab24 100644 --- a/src/actionGroups/groupRegistry.vala +++ b/src/actionGroups/groupRegistry.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -54,28 +54,40 @@ public class GroupRegistry : GLib.Object { TypeDescription type_description; type_description = BookmarkGroup.register(); - types.add(typeof(BookmarkGroup).name()); - descriptions.set(typeof(BookmarkGroup).name(), type_description); + if (type_description != null) { + types.add(typeof(BookmarkGroup).name()); + descriptions.set(typeof(BookmarkGroup).name(), type_description); + } type_description = ClipboardGroup.register(); - types.add(typeof(ClipboardGroup).name()); - descriptions.set(typeof(ClipboardGroup).name(), type_description); + if (type_description != null) { + types.add(typeof(ClipboardGroup).name()); + descriptions.set(typeof(ClipboardGroup).name(), type_description); + } type_description = DevicesGroup.register(); - types.add(typeof(DevicesGroup).name()); - descriptions.set(typeof(DevicesGroup).name(), type_description); + if (type_description != null) { + types.add(typeof(DevicesGroup).name()); + descriptions.set(typeof(DevicesGroup).name(), type_description); + } type_description = MenuGroup.register(); - types.add(typeof(MenuGroup).name()); - descriptions.set(typeof(MenuGroup).name(), type_description); + if (type_description != null) { + types.add(typeof(MenuGroup).name()); + descriptions.set(typeof(MenuGroup).name(), type_description); + } type_description = SessionGroup.register(); - types.add(typeof(SessionGroup).name()); - descriptions.set(typeof(SessionGroup).name(), type_description); + if (type_description != null) { + types.add(typeof(SessionGroup).name()); + descriptions.set(typeof(SessionGroup).name(), type_description); + } type_description = WindowListGroup.register(); - types.add(typeof(WindowListGroup).name()); - descriptions.set(typeof(WindowListGroup).name(), type_description); + if (type_description != null) { + types.add(typeof(WindowListGroup).name()); + descriptions.set(typeof(WindowListGroup).name(), type_description); + } } ///////////////////////////////////////////////////////////////////// @@ -83,6 +95,8 @@ public class GroupRegistry : GLib.Object { ///////////////////////////////////////////////////////////////////// public static ActionGroup? create_group(string type_id, string parent_id) { + bool wayland = GLib.Environment.get_variable("XDG_SESSION_TYPE") == "wayland"; + switch (type_id) { case "bookmarks": return new BookmarkGroup(parent_id); @@ -95,9 +109,11 @@ public class GroupRegistry : GLib.Object { case "session": return new SessionGroup(parent_id); case "window_list": + if (wayland) return null; return new WindowListGroup(parent_id); // deprecated case "workspace_window_list": + if (wayland) return null; var group = new WindowListGroup(parent_id); group.current_workspace_only = true; return group; diff --git a/src/actionGroups/menuGroup.vala b/src/actionGroups/menuGroup.vala index 353128f..92071d0 100644 --- a/src/actionGroups/menuGroup.vala +++ b/src/actionGroups/menuGroup.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -135,7 +135,8 @@ public class MenuGroup : ActionGroup { // get icon var icon = item.get_directory().get_icon(); - var sub_menu = PieManager.create_dynamic_pie(item.get_directory().get_name(), Icon.get_icon_name(icon)); + var sub_menu = PieManager.create_dynamic_pie(item.get_directory().get_name(), + icon.to_string()); var group = new MenuGroup.sub_menu(sub_menu.id); group.add_action(new PieAction(parent_id, true)); group.load_contents(item.get_directory(), sub_menu.id); diff --git a/src/actionGroups/sessionGroup.vala b/src/actionGroups/sessionGroup.vala index 5d47674..f044a72 100644 --- a/src/actionGroups/sessionGroup.vala +++ b/src/actionGroups/sessionGroup.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/actionGroups/windowListGroup.vala b/src/actionGroups/windowListGroup.vala index c3560af..c572f75 100644 --- a/src/actionGroups/windowListGroup.vala +++ b/src/actionGroups/windowListGroup.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -29,7 +29,12 @@ public class WindowListGroup : ActionGroup { /// the pies.conf file for this kind of ActionGroups. ///////////////////////////////////////////////////////////////////// - public static GroupRegistry.TypeDescription register() { + public static GroupRegistry.TypeDescription? register() { + if (GLib.Environment.get_variable("XDG_SESSION_TYPE") == "wayland") { + warning("The WindowList slice group is not supported on Wayland."); + return null; + } + var description = new GroupRegistry.TypeDescription(); description.name = _("Group: Window List"); description.icon = "preferences-system-windows"; @@ -41,12 +46,14 @@ public class WindowListGroup : ActionGroup { public bool current_workspace_only { get; set; default=false; } ///////////////////////////////////////////////////////////////////// - /// Two members needed to avoid useless, frequent changes of the - /// stored Actions. + /// Cached icon names loaded from .desktop files. ///////////////////////////////////////////////////////////////////// - private bool changing = false; - private bool changed_again = false; + private static Gee.HashMap cached_icon_name { private get; private set; } + + ///////////////////////////////////////////////////////////////////// + /// Wnck's Screen object, to control the list of opened windows. + ///////////////////////////////////////////////////////////////////// private Wnck.Screen screen; @@ -56,24 +63,22 @@ public class WindowListGroup : ActionGroup { public WindowListGroup(string parent_id) { GLib.Object(parent_id : parent_id); - } - ///////////////////////////////////////////////////////////////////// - /// Loads all windows. - ///////////////////////////////////////////////////////////////////// + screen = Wnck.Screen.get_default(); + WindowListGroup.cached_icon_name = new Gee.HashMap(); - construct { - this.screen = Wnck.Screen.get_default(); + Gtk.IconTheme.get_default().changed.connect(() => { + WindowListGroup.cached_icon_name = new Gee.HashMap(); + create_actions_for_all_windows(); + }); - this.screen.window_opened.connect(reload); - this.screen.window_closed.connect(reload); - this.screen.active_workspace_changed.connect(reload); - - this.update(); + screen.active_workspace_changed.connect(create_actions_for_all_windows); + screen.window_opened.connect(create_action); + screen.window_closed.connect(remove_action); } ///////////////////////////////////////////////////////////////////// - /// This one is called, when the ActionGroup is saved. + /// This one is called when the ActionGroup is saved. ///////////////////////////////////////////////////////////////////// public override void on_save(Xml.TextWriter writer) { @@ -82,7 +87,7 @@ public class WindowListGroup : ActionGroup { } ///////////////////////////////////////////////////////////////////// - /// This one is called, when the ActionGroup is loaded. + /// This one is called when the ActionGroup is loaded. ///////////////////////////////////////////////////////////////////// public override void on_load(Xml.Node* data) { @@ -91,98 +96,117 @@ public class WindowListGroup : ActionGroup { string attr_content = attribute->children->content; if (attr_name == "current_workspace_only") { - this.current_workspace_only = bool.parse(attr_content); + current_workspace_only = bool.parse(attr_content); } } } ///////////////////////////////////////////////////////////////////// - /// Loads all currently opened windows and creates actions for them. + /// Remove a Action for a given window ///////////////////////////////////////////////////////////////////// - private void update() { - unowned GLib.List windows = this.screen.get_windows(); - - foreach (var window in windows) { - if (window.get_window_type() == Wnck.WindowType.NORMAL - && !window.is_skip_pager() && !window.is_skip_tasklist() - && (!current_workspace_only || (window.get_workspace() != null - && window.get_workspace() == this.screen.get_active_workspace()))) { - - var application = window.get_application(); - var icon = application.get_icon_name().down(); - var name = window.get_name(); - - if (name.length > 30) { - name = name.substring(0, 30) + "..."; + private void remove_action(Wnck.Window window) { + if (!window.is_skip_pager() && !window.is_skip_tasklist()) + foreach (Action action in actions) + if (window.get_xid() == uint64.parse(action.real_command)) { + actions.remove(action); + break; } + } - var action = new SigAction(name, icon, "%lu".printf(window.get_xid())); + ///////////////////////////////////////////////////////////////////// + /// Create Action's for all currently opened windows. + ///////////////////////////////////////////////////////////////////// - action.activated.connect((time_stamp) => { - Wnck.Screen.get_default().force_update(); + private void create_actions_for_all_windows() { + delete_all(); - var xid = (X.Window)uint64.parse(action.real_command); - var win = Wnck.Window.get(xid); + foreach (var window in screen.get_windows()) + create_action(window); + } - if (win.get_workspace() != null) { - //select the workspace - if (win.get_workspace() != win.get_screen().get_active_workspace()) { - win.get_workspace().activate(time_stamp); - } + ///////////////////////////////////////////////////////////////////// + /// Create a Action for a given opened window + ///////////////////////////////////////////////////////////////////// - //select the viewport inside the workspace - if (!win.is_in_viewport(win.get_workspace()) ) { - int xp, yp, widthp, heightp, scx, scy, nx, ny, wx, wy; - win.get_geometry (out xp, out yp, out widthp, out heightp); - scx = win.get_screen().get_width(); - scy = win.get_screen().get_height(); - wx = win.get_workspace().get_viewport_x(); - wy = win.get_workspace().get_viewport_y(); - if (scx > 0 && scy > 0) { - nx= ((wx+xp) / scx) * scx; - ny= ((wy+yp) / scy) * scy; - win.get_screen().move_viewport(nx, ny); - } - } - } + private void create_action(Wnck.Window window) { + if (!window.is_skip_pager() && !window.is_skip_tasklist() + && (!current_workspace_only || (window.get_workspace() != null + && window.get_workspace() == screen.get_active_workspace()))) { - if (win.is_minimized()) { - win.unminimize(time_stamp); - } + var name = window.get_name(); + var icon_name = get_icon_name(window); + var xid = "%lu".printf(window.get_xid()); - win.activate_transient(time_stamp); - }); - this.add_action(action); + if (name.length > 30) { + name = name.substring(0, 30) + "..."; } - } - } - ///////////////////////////////////////////////////////////////////// - /// Reloads all running applications. - ///////////////////////////////////////////////////////////////////// + var action = new SigAction(name, icon_name, xid); + this.add_action(action); - private void reload() { - // avoid too frequent changes... - if (!this.changing) { - this.changing = true; - Timeout.add(500, () => { - if (this.changed_again) { - this.changed_again = false; - return true; + window.name_changed.connect(() => { + action.name = window.get_name(); + }); + + action.activated.connect((time_stamp) => { + if (window.get_workspace() != null) { + //select the workspace + if (window.get_workspace() != window.get_screen().get_active_workspace()) { + window.get_workspace().activate(time_stamp); + } } - // reload - this.delete_all(); - this.update(); + if (window.is_minimized()) { + window.unminimize(time_stamp); + } - this.changing = false; - return false; + window.activate_transient(time_stamp); }); - } else { - this.changed_again = true; } } + + private string get_icon_name(Wnck.Window window) { + string icon_name = ""; + + #if HAVE_BAMF + var xid = (uint32) window.get_xid(); + Bamf.Matcher bamf_matcher = Bamf.Matcher.get_default(); + Bamf.Application app = bamf_matcher.get_application_for_xid(xid); + string desktop_file = null; + + if (app != null) + desktop_file = app.get_desktop_file(); + + if (desktop_file != null) { + if (WindowListGroup.cached_icon_name.has_key(desktop_file)) + icon_name = WindowListGroup.cached_icon_name.get(desktop_file); + else { + try { + var file = new KeyFile(); + file.load_from_file(desktop_file, 0); + + if (file.has_key(KeyFileDesktop.GROUP, KeyFileDesktop.KEY_ICON)) { + icon_name = file.get_locale_string(KeyFileDesktop.GROUP, KeyFileDesktop.KEY_ICON); + WindowListGroup.cached_icon_name.set(desktop_file, icon_name); + } + } catch (GLib.KeyFileError e) { + error("%s", e.message); + } catch (GLib.FileError e) { + error("%s", e.message); + } + } + } else { + var application = window.get_application(); + icon_name = application.get_icon_name().down(); + } + #else + var application = window.get_application(); + icon_name = application.get_icon_name().down(); + #endif + + return icon_name; + } } } diff --git a/src/actions/action.vala b/src/actions/action.vala index 555dc3c..6293302 100644 --- a/src/actions/action.vala +++ b/src/actions/action.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/actions/actionRegistry.vala b/src/actions/actionRegistry.vala index 579fc93..1640a1e 100644 --- a/src/actions/actionRegistry.vala +++ b/src/actions/actionRegistry.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -138,7 +138,7 @@ public class ActionRegistry : GLib.Object { // search for an appropriate icon var icon = info.get_icon(); - final_icon = Icon.get_icon_name(icon); + final_icon = icon.to_string(); } catch (GLib.Error e) { warning(e.message); @@ -147,9 +147,6 @@ public class ActionRegistry : GLib.Object { break; } - if (!Gtk.IconTheme.get_default().has_icon(final_icon)) - final_icon = "stock_unknown"; - if (name != null) final_name = name; @@ -164,7 +161,8 @@ public class ActionRegistry : GLib.Object { // get icon var icon = info.get_icon(); - return new AppAction(info.get_display_name(), Icon.get_icon_name(icon), info.get_commandline()); + return new AppAction(info.get_display_name(), icon.to_string(), + info.get_commandline()); } ///////////////////////////////////////////////////////////////////// diff --git a/src/actions/appAction.vala b/src/actions/appAction.vala index cc98c1e..4b55f91 100644 --- a/src/actions/appAction.vala +++ b/src/actions/appAction.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/actions/keyAction.vala b/src/actions/keyAction.vala index 41dab61..99418cd 100644 --- a/src/actions/keyAction.vala +++ b/src/actions/keyAction.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/actions/pieAction.vala b/src/actions/pieAction.vala index 806d63b..fe266dd 100644 --- a/src/actions/pieAction.vala +++ b/src/actions/pieAction.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/actions/sigAction.vala b/src/actions/sigAction.vala index fdde40a..fb241ca 100644 --- a/src/actions/sigAction.vala +++ b/src/actions/sigAction.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/actions/uriAction.vala b/src/actions/uriAction.vala index 2dde62d..74b3a15 100644 --- a/src/actions/uriAction.vala +++ b/src/actions/uriAction.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/daemon.vala b/src/daemon.vala index 0d111de..32f7e11 100644 --- a/src/daemon.vala +++ b/src/daemon.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -49,12 +49,14 @@ public class Daemon : GLib.Application { ///////////////////////////////////////////////////////////////////// public static int main(string[] args) { - version = "0.7.0"; + version = "0.7.1"; // disable overlay scrollbar --- hacky workaround for black / // transparent background GLib.Environment.set_variable("LIBOVERLAY_SCROLLBAR", "0", true); + Wnck.set_client_type(Wnck.ClientType.PAGER); + Logger.init(); Gtk.init(ref args); Paths.init(); diff --git a/src/gui/aboutWindow.vala b/src/gui/aboutWindow.vala index cddca63..da72417 100644 --- a/src/gui/aboutWindow.vala +++ b/src/gui/aboutWindow.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -33,7 +33,8 @@ public class AboutWindow: Gtk.AboutDialog { "Simon Schneegans ", "Gabriel Dubatti ", "Francesco Piccinno ", - "György Balló " + "György Balló ", + "Tiago de Oliveira Corrêa " }; string[] artists = { "Simon Schneegans " @@ -50,6 +51,7 @@ public class AboutWindow: Gtk.AboutDialog { "Raphaël Rochet (FR)", "Alex Maxime (FR)", "Eugene Roskin (RU)", + "Ashed (RU)", "Ting Zhou (ZH-CN)", "Martin Dinov (BG)" }; @@ -71,7 +73,7 @@ public class AboutWindow: Gtk.AboutDialog { artists : artists, authors : devs, translator_credits : translator_string, - copyright : "Copyright (C) 2011-2015 Simon Schneegans ", + copyright : "Copyright (C) 2011-2017 Simon Schneegans ", program_name: "Gnome-Pie", logo_icon_name: "gnome-pie", website: "http://simmesimme.github.io/gnome-pie.html", diff --git a/src/gui/commandComboList.vala b/src/gui/commandComboList.vala index 3f157ce..640c7b7 100644 --- a/src/gui/commandComboList.vala +++ b/src/gui/commandComboList.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/gui/iconSelectWindow.vala b/src/gui/iconSelectWindow.vala index d7e5062..6776288 100644 --- a/src/gui/iconSelectWindow.vala +++ b/src/gui/iconSelectWindow.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -106,7 +106,6 @@ public class IconSelectWindow : GLib.Object { private class ListEntry { public string name; - public IconContext context; public Gdk.Pixbuf pixbuf; } @@ -118,20 +117,6 @@ public class IconSelectWindow : GLib.Object { private GLib.AsyncQueue load_queue; - ///////////////////////////////////////////////////////////////////// - /// Possible icon types. - ///////////////////////////////////////////////////////////////////// - - private enum IconContext { - ALL, - APPS, - ACTIONS, - PLACES, - FILES, - EMOTES, - OTHER - } - ///////////////////////////////////////////////////////////////////// /// C'tor, creates a new IconSelectWindow. ///////////////////////////////////////////////////////////////////// @@ -141,9 +126,8 @@ public class IconSelectWindow : GLib.Object { this.load_queue = new GLib.AsyncQueue(); if (IconSelectWindow.icon_list == null) { - IconSelectWindow.icon_list = new Gtk.ListStore(3, typeof(string), // icon name - typeof(IconContext), // icon type - typeof(Gdk.Pixbuf)); // the icon itself + IconSelectWindow.icon_list = new Gtk.ListStore(2, typeof(string), // icon name + typeof(Gdk.Pixbuf)); // the icon itself // disable sorting until all icons are loaded // else loading becomes horribly slow @@ -175,26 +159,6 @@ public class IconSelectWindow : GLib.Object { (builder.get_object("ok-button") as Gtk.Button).clicked.connect(on_ok_button_clicked); (builder.get_object("cancel-button") as Gtk.Button).clicked.connect(on_cancel_button_clicked); - var combo_box = builder.get_object("combo-box") as Gtk.Box; - - // context combo - var context_combo = new Gtk.ComboBoxText(); - context_combo.append_text(_("All icons")); - context_combo.append_text(_("Applications")); - context_combo.append_text(_("Actions")); - context_combo.append_text(_("Places")); - context_combo.append_text(_("File types")); - context_combo.append_text(_("Emotes")); - context_combo.append_text(_("Miscellaneous")); - - context_combo.set_active(0); - - context_combo.changed.connect(() => { - this.icon_list_filtered.refilter(); - }); - - combo_box.pack_start(context_combo, false, false); - // string filter entry var filter = builder.get_object("filter-entry") as Gtk.Entry; @@ -202,21 +166,16 @@ public class IconSelectWindow : GLib.Object { // and whose name contains the text entered in the entry this.icon_list_filtered.set_visible_func((model, iter) => { string name = ""; - IconContext context = IconContext.ALL; model.get(iter, 0, out name); - model.get(iter, 1, out context); - if (name == null) return false; - - return (context_combo.get_active() == context || - context_combo.get_active() == IconContext.ALL) && - name.down().contains(filter.text.down()); + return name.down().contains(filter.text.down()); }); // clear when the users clicks on the "clear" icon filter.icon_release.connect((pos, event) => { - if (pos == Gtk.EntryIconPosition.SECONDARY) + if (pos == Gtk.EntryIconPosition.SECONDARY) { filter.text = ""; + } }); // refilter on input @@ -231,7 +190,7 @@ public class IconSelectWindow : GLib.Object { this.icon_view = new Gtk.IconView.with_model(this.icon_list_filtered); this.icon_view.item_width = 32; this.icon_view.item_padding = 2; - this.icon_view.pixbuf_column = 2; + this.icon_view.pixbuf_column = 1; this.icon_view.tooltip_column = 0; // set active_icon if selection changes @@ -376,8 +335,7 @@ public class IconSelectWindow : GLib.Object { Gtk.TreeIter current; IconSelectWindow.icon_list.append(out current); IconSelectWindow.icon_list.set(current, 0, new_entry.name, - 1, new_entry.context, - 2, new_entry.pixbuf); + 1, new_entry.pixbuf); } // enable sorting of the icon_view if loading finished @@ -397,44 +355,20 @@ public class IconSelectWindow : GLib.Object { private async void load_all() { var icon_theme = Gtk.IconTheme.get_default(); + foreach (var icon in icon_theme.list_icons(null)) { + Idle.add(load_all.callback); + yield; - foreach (var context in icon_theme.list_contexts()) { - if (!disabled_contexts.contains(context)) { - foreach (var icon in icon_theme.list_icons(context)) { - - IconContext icon_context = IconContext.OTHER; - switch(context) { - case "Apps": case "Applications": - icon_context = IconContext.APPS; break; - case "Emotes": - icon_context = IconContext.EMOTES; break; - case "Places": case "Devices": - icon_context = IconContext.PLACES; break; - case "Mimetypes": - icon_context = IconContext.FILES; break; - case "Actions": - icon_context = IconContext.ACTIONS; break; - default: break; - } - - Idle.add(load_all.callback); - yield; - - try { - // create a new entry for the queue - var new_entry = new ListEntry(); - new_entry.name = icon; - new_entry.context = icon_context; - new_entry.pixbuf = icon_theme.load_icon(icon, 32, 0); + try { + // create a new entry for the queue + var new_entry = new ListEntry(); + new_entry.name = icon; + new_entry.pixbuf = icon_theme.load_icon(icon, 32, Gtk.IconLookupFlags.FORCE_SIZE); - // some icons have only weird sizes... do not include them - if (new_entry.pixbuf.width == 32) - this.load_queue.push(new_entry); + this.load_queue.push(new_entry); - } catch (GLib.Error e) { - warning("Failed to load image " + icon); - } - } + } catch (GLib.Error e) { + warning("Failed to load image " + icon); } } @@ -442,8 +376,9 @@ public class IconSelectWindow : GLib.Object { IconSelectWindow.loading = false; // hide the spinner - if (spinner != null) + if (spinner != null) { spinner.visible = false; + } } } diff --git a/src/gui/indicator.vala b/src/gui/indicator.vala index 55baaf1..ddd101b 100644 --- a/src/gui/indicator.vala +++ b/src/gui/indicator.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -68,13 +68,6 @@ public class Indicator : GLib.Object { public Indicator() { string icon = "gnome-pie-symbolic"; - var screen = (Gdk.X11.Screen)Gdk.Screen.get_default(); - bool gnome_shell = false; - - if (screen.get_window_manager_name() == "GNOME Shell") { - icon = "gnome-pie"; - gnome_shell = true; - } #if HAVE_APPINDICATOR @@ -85,19 +78,9 @@ public class Indicator : GLib.Object { warning("Failed to get path of executable!"); } - if (gnome_shell) { - - if (GLib.File.new_for_path(path).query_exists()) { - this.indicator = new AppIndicator.Indicator("Gnome-Pie", path + "/" + icon + ".svg", - AppIndicator.IndicatorCategory.APPLICATION_STATUS); - } else { - this.indicator = new AppIndicator.Indicator("Gnome-Pie", icon, - AppIndicator.IndicatorCategory.APPLICATION_STATUS); - } - } else { - this.indicator = new AppIndicator.Indicator.with_path("Gnome-Pie", icon, - AppIndicator.IndicatorCategory.APPLICATION_STATUS, path); - } + this.indicator = new AppIndicator.Indicator.with_path("Gnome-Pie", icon, + AppIndicator.IndicatorCategory.APPLICATION_STATUS, path); + var menu = new Gtk.Menu(); #else this.indicator = new Gtk.StatusIcon(); diff --git a/src/gui/newSliceWindow.vala b/src/gui/newSliceWindow.vala index 3133e34..6ea25d5 100644 --- a/src/gui/newSliceWindow.vala +++ b/src/gui/newSliceWindow.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/gui/newsWindow.vala b/src/gui/newsWindow.vala index 2ab13c0..f359ae9 100644 --- a/src/gui/newsWindow.vala +++ b/src/gui/newsWindow.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ namespace GnomePie { public class NewsWindow: Gtk.Dialog { - public static const int news_count = 2; + public const int news_count = 2; ///////////////////////////////////////////////////////////////////// /// diff --git a/src/gui/pieComboList.vala b/src/gui/pieComboList.vala index 6a5c172..96230c0 100644 --- a/src/gui/pieComboList.vala +++ b/src/gui/pieComboList.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/gui/pieList.vala b/src/gui/pieList.vala index ed93098..1f6ccec 100644 --- a/src/gui/pieList.vala +++ b/src/gui/pieList.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/gui/pieOptionsWindow.vala b/src/gui/pieOptionsWindow.vala index 5440305..ea50a53 100644 --- a/src/gui/pieOptionsWindow.vala +++ b/src/gui/pieOptionsWindow.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -46,6 +46,8 @@ public class PieOptionsWindow : GLib.Object { private Gtk.Button? icon_button = null; private Gtk.Image? icon = null; private Gtk.Label? pie_id = null; + private Gtk.Label? hint = null; + private Gtk.Frame? optionsFrame = null; private IconSelectWindow? icon_window = null; @@ -141,6 +143,10 @@ public class PieOptionsWindow : GLib.Object { this.icon_button = builder.get_object("icon-button") as Gtk.Button; this.icon_button.clicked.connect(on_icon_button_clicked); + this.hint = builder.get_object("hint") as Gtk.Label; + + this.optionsFrame = builder.get_object("optionsFrame") as Gtk.Frame; + this.window.delete_event.connect(this.window.hide_on_delete); } catch (GLib.Error e) { @@ -163,6 +169,10 @@ public class PieOptionsWindow : GLib.Object { public void show() { this.window.show_all(); + + if (GLib.Environment.get_variable("XDG_SESSION_TYPE") == "wayland") { + this.optionsFrame.visible = false; + } } ///////////////////////////////////////////////////////////////////// @@ -187,6 +197,15 @@ public class PieOptionsWindow : GLib.Object { this.pie_id.label = "Pie-ID: " + id; this.trigger_button.set_trigger(trigger); this.set_icon(pie.icon); + + if (GLib.Environment.get_variable("XDG_SESSION_TYPE") == "wayland") { + this.trigger_button.set_sensitive(false); + + this.hint.set_line_wrap(true); + this.hint.set_max_width_chars(40); + this.hint.set_justify(Gtk.Justification.RIGHT); + this.hint.set_label(_("Keybindings and some other options are not supported on Wayland. However, you can use the terminial command \"gnome-pie --open %s\" to open this pie. Create a global hotkey in your system settings which executes this command!").printf(id)); + } } ///////////////////////////////////////////////////////////////////// diff --git a/src/gui/piePreview.vala b/src/gui/piePreview.vala index 540ab51..6c23590 100644 --- a/src/gui/piePreview.vala +++ b/src/gui/piePreview.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -170,10 +170,7 @@ class PiePreview : Gtk.DrawingArea { ///////////////////////////////////////////////////////////////////// public void set_pie(string id) { - var style = this.get_style_context(); - this.current_id = id; - this.override_background_color(Gtk.StateFlags.NORMAL, style.get_background_color(Gtk.StateFlags.NORMAL)); this.renderer.load_pie(PieManager.all_pies[id]); if (id == this.drag_start_id) { diff --git a/src/gui/piePreviewAddSign.vala b/src/gui/piePreviewAddSign.vala index b5bbe53..2674879 100644 --- a/src/gui/piePreviewAddSign.vala +++ b/src/gui/piePreviewAddSign.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/gui/piePreviewCenter.vala b/src/gui/piePreviewCenter.vala index 2da47e6..2e9923e 100644 --- a/src/gui/piePreviewCenter.vala +++ b/src/gui/piePreviewCenter.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/gui/piePreviewDeleteSign.vala b/src/gui/piePreviewDeleteSign.vala index 05afd5b..0b63aa6 100644 --- a/src/gui/piePreviewDeleteSign.vala +++ b/src/gui/piePreviewDeleteSign.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -42,9 +42,9 @@ public class PiePreviewDeleteSign : GLib.Object { /// Some constants determining the look and behaviour of this Slice. ///////////////////////////////////////////////////////////////////// - private static const int radius = 18; - private static const double globale_scale = 0.8; - private static const double click_cancel_treshold = 5; + private const int radius = 18; + private const double globale_scale = 0.8; + private const double click_cancel_treshold = 5; ///////////////////////////////////////////////////////////////////// /// True, when the add sign is currently visible. diff --git a/src/gui/piePreviewRenderer.vala b/src/gui/piePreviewRenderer.vala index dbd929a..d7dad25 100644 --- a/src/gui/piePreviewRenderer.vala +++ b/src/gui/piePreviewRenderer.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/gui/piePreviewSliceRenderer.vala b/src/gui/piePreviewSliceRenderer.vala index 35cb0a2..622e0dd 100644 --- a/src/gui/piePreviewSliceRenderer.vala +++ b/src/gui/piePreviewSliceRenderer.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -72,11 +72,11 @@ public class PiePreviewSliceRenderer : GLib.Object { /// Some constants determining the look and behaviour of this Slice. ///////////////////////////////////////////////////////////////////// - private static const double pie_radius = 126; - private static const double radius = 24; - private static const double delete_x = 13; - private static const double delete_y = -13; - private static const double click_cancel_treshold = 5; + private const double pie_radius = 126; + private const double radius = 24; + private const double delete_x = 13; + private const double delete_y = -13; + private const double click_cancel_treshold = 5; ///////////////////////////////////////////////////////////////////// /// Storing the position where a mouse click was executed. Useful for diff --git a/src/gui/preferencesWindow.vala b/src/gui/preferencesWindow.vala index 1fedfb2..8c6c66c 100644 --- a/src/gui/preferencesWindow.vala +++ b/src/gui/preferencesWindow.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -163,7 +163,7 @@ public class PreferencesWindow : GLib.Object { (builder.get_object("theme-help-button") as Gtk.Button).clicked.connect(() => { try{ - GLib.AppInfo.launch_default_for_uri("http://simmesimme.github.io/lessons/2015/04/26/themes-for-gnome-pie/", null); + GLib.AppInfo.launch_default_for_uri("http://simmesimme.github.io/lessons/2015/04/26/themes-for-gnome-pie", null); } catch (Error e) { warning(e.message); } @@ -281,9 +281,6 @@ public class PreferencesWindow : GLib.Object { this.window.show_all(); this.pie_list.select_first(); - var style = this.preview_background.get_style_context(); - this.preview_background.override_background_color(Gtk.StateFlags.NORMAL, style.get_background_color(Gtk.StateFlags.NORMAL)); - this.indicator.active = Config.global.show_indicator; this.autostart.active = Config.global.auto_start; this.captions.active = Config.global.show_captions; @@ -532,15 +529,17 @@ public class PreferencesWindow : GLib.Object { } else { var pie = PieManager.all_pies[selected_id]; - this.preview.set_pie(id); - this.preview_box.show(); + if (pie != null) { + this.preview.set_pie(id); + this.preview_box.show(); - if (pie.action_groups.size == 0) { - this.no_slice_label.show(); - } + if (pie.action_groups.size == 0) { + this.no_slice_label.show(); + } - this.remove_pie_button.sensitive = true; - this.edit_pie_button.sensitive = true; + this.remove_pie_button.sensitive = true; + this.edit_pie_button.sensitive = true; + } } } diff --git a/src/gui/sliceTypeList.vala b/src/gui/sliceTypeList.vala index 2dcf16b..cec9ce3 100644 --- a/src/gui/sliceTypeList.vala +++ b/src/gui/sliceTypeList.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/gui/themeList.vala b/src/gui/themeList.vala index 8e7b190..022b57d 100644 --- a/src/gui/themeList.vala +++ b/src/gui/themeList.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/gui/tipViewer.vala b/src/gui/tipViewer.vala index e484315..24b4ccc 100644 --- a/src/gui/tipViewer.vala +++ b/src/gui/tipViewer.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -69,8 +69,6 @@ public class TipViewer : Gtk.Label { this.wrap = true; this.valign = Gtk.Align.END; this.set_use_markup(true); - - this.override_font(Pango.FontDescription.from_string("8")); } ///////////////////////////////////////////////////////////////////// @@ -155,7 +153,7 @@ public class TipViewer : Gtk.Label { next_index = GLib.Random.int_range(0, tips.length); } while (next_index == this.index); this.index = next_index; - this.label = tips[this.index]; + this.label = "" + tips[this.index] + ""; } } } diff --git a/src/gui/triggerSelectButton.vala b/src/gui/triggerSelectButton.vala index c870f84..c70f1cd 100644 --- a/src/gui/triggerSelectButton.vala +++ b/src/gui/triggerSelectButton.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -63,7 +63,7 @@ public class TriggerSelectButton : Gtk.ToggleButton { if (this.active) { this.set_label(_("Press a hotkey ...")); Gtk.grab_add(this); - FocusGrabber.grab(this.get_window(), true, true, true); + FocusGrabber.grab(this.get_window()); } }); @@ -89,7 +89,7 @@ public class TriggerSelectButton : Gtk.ToggleButton { this.set_label(trigger.label); this.set_active(false); Gtk.grab_remove(this); - FocusGrabber.ungrab(true, true); + FocusGrabber.ungrab(); } ///////////////////////////////////////////////////////////////////// diff --git a/src/images/icon.vala b/src/images/icon.vala index 176e187..7933e81 100644 --- a/src/images/icon.vala +++ b/src/images/icon.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -74,61 +74,44 @@ public class Icon : Image { return base.width(); } - ///////////////////////////////////////////////////////////////////// - /// Returns the icon name for a given GLib.Icon. - ///////////////////////////////////////////////////////////////////// - - public static string get_icon_name(GLib.Icon? icon) { - if (icon != null) { - var icon_names = icon.to_string().split(" "); - - foreach (var icon_name in icon_names) { - if (Gtk.IconTheme.get_default().has_icon(icon_name)) { - return icon_name; - } - } - } - - return ""; - } - ///////////////////////////////////////////////////////////////////// /// Returns the filename for a given system icon. ///////////////////////////////////////////////////////////////////// public static string get_icon_file(string icon_name, int size) { - string result = ""; - if (icon_name.contains("/")) { var file = GLib.File.new_for_path(icon_name); - if(file.query_exists()) + if(file.query_exists()) { return icon_name; - - warning("Icon \"" + icon_name + "\" not found! Using default icon..."); + } } - var icon_theme = Gtk.IconTheme.get_default(); var file = icon_theme.lookup_icon(icon_name, size, 0); - if (file != null) result = file.get_filename(); - - if (result == "") { - warning("Icon \"" + icon_name + "\" not found! Using default icon..."); - - string[] default_icons = {"application-default-icon", "stock_unknown"}; - foreach (var icon in default_icons) { - file = icon_theme.lookup_icon(icon, size, 0); - if (file != null) { - result = file.get_filename(); - break; - } + if (file != null) { + return file.get_filename(); + } + + try { + file = icon_theme.lookup_by_gicon(GLib.Icon.new_for_string(icon_name), size, 0); + if (file != null) { + return file.get_filename(); } + } catch(GLib.Error e) {} + + warning("Icon \"" + icon_name + "\" not found! Using default icon..."); - if (result == "") - warning("No default icon found! Will be ugly..."); + string[] default_icons = {"image-missing", "application-default-icon"}; + foreach (var icon in default_icons) { + file = icon_theme.lookup_icon(icon, size, 0); + if (file != null) { + return file.get_filename(); + } } - return result; + warning("No default icon found! Will be ugly..."); + + return ""; } } diff --git a/src/images/image.vala b/src/images/image.vala index 840a8ad..9a00f45 100644 --- a/src/images/image.vala +++ b/src/images/image.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/images/renderedText.vala b/src/images/renderedText.vala index f00c8b5..cae6ee3 100644 --- a/src/images/renderedText.vala +++ b/src/images/renderedText.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/images/themedIcon.vala b/src/images/themedIcon.vala index 9dd9609..6ab5741 100644 --- a/src/images/themedIcon.vala +++ b/src/images/themedIcon.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/pies/defaultConfig.vala b/src/pies/defaultConfig.vala index 4041111..d832347 100644 --- a/src/pies/defaultConfig.vala +++ b/src/pies/defaultConfig.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -63,8 +63,10 @@ namespace Pies { window.add_action(new KeyAction(_("Restore"), "view-restore", "F5")); // add a pie with window list group - var alt_tab = PieManager.create_persistent_pie("Alt Tab", "dock", new Trigger.from_string("T")); + if (GLib.Environment.get_variable("XDG_SESSION_TYPE") != "wayland") { + var alt_tab = PieManager.create_persistent_pie("Alt Tab", "preferences-system-windows", new Trigger.from_string("T")); alt_tab.add_group(new WindowListGroup(alt_tab.id)); + } // save the configuration to file Pies.save(); diff --git a/src/pies/load.vala b/src/pies/load.vala index 20e18d8..976d818 100644 --- a/src/pies/load.vala +++ b/src/pies/load.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -199,9 +199,11 @@ namespace Pies { } ActionGroup group = GroupRegistry.create_group(type, pie.id); - group.on_load(slice); - if (group != null) pie.add_group(group); + if (group != null) { + group.on_load(slice); + pie.add_group(group); + } } } diff --git a/src/pies/pie.vala b/src/pies/pie.vala index be17238..ef5549c 100644 --- a/src/pies/pie.vala +++ b/src/pies/pie.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/pies/pieManager.vala b/src/pies/pieManager.vala index d9bf5b7..6951508 100644 --- a/src/pies/pieManager.vala +++ b/src/pies/pieManager.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/pies/save.vala b/src/pies/save.vala index 0a2d401..2c5e191 100644 --- a/src/pies/save.vala +++ b/src/pies/save.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/renderers/centerRenderer.vala b/src/renderers/centerRenderer.vala index 88b569c..65a28fa 100644 --- a/src/renderers/centerRenderer.vala +++ b/src/renderers/centerRenderer.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -188,8 +188,9 @@ public class CenterRenderer : GLib.Object { // draw caption if (Config.global.theme.caption && caption != null && this.activity.val > 0) { ctx.save(); - ctx.identity_matrix(); - ctx.translate(this.parent.center_x, (int)(Config.global.theme.caption_position) + this.parent.center_y); + double x, y; + ctx.get_current_point(out x, out y); + ctx.move_to(GLib.Math.floor(x), GLib.Math.floor(y)); caption.paint_on(ctx, this.activity.val*this.alpha.val); ctx.restore(); } diff --git a/src/renderers/pieRenderer.vala b/src/renderers/pieRenderer.vala index 32f3a5f..47d8b8e 100644 --- a/src/renderers/pieRenderer.vala +++ b/src/renderers/pieRenderer.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -175,28 +175,6 @@ public class PieRenderer : GLib.Object { set_show_mode(ShowPieMode.FULL_PIE); } - - private void get_mouse_and_screen(out int mousex, out int mousey, out int screenx, out int screeny) { - // get the mouse position and screen resolution - double x = 0.0; - double y = 0.0; - - var display = Gdk.Display.get_default(); - var manager = display.get_device_manager(); - GLib.List list = manager.list_devices(Gdk.DeviceType.MASTER); - - foreach(var device in list) { - if (device.input_source != Gdk.InputSource.KEYBOARD) { - Gdk.Screen screen; - device.get_position( out screen, out x, out y ); - } - } - mousex= (int) x; - mousey= (int) y; - screenx= Gdk.Screen.width(); - screeny= Gdk.Screen.height(); - } - ///////////////////////////////////////////////////////////////////// /// Loads a Pie. All members are initialized accordingly. ///////////////////////////////////////////////////////////////////// @@ -239,12 +217,40 @@ public class PieRenderer : GLib.Object { + Config.global.theme.visible_slice_radius)*2*Config.global.theme.max_zoom); } - - - // get mouse position and screen resolution - int mouse_x, mouse_y, screen_x, screen_y; - get_mouse_and_screen( out mouse_x, out mouse_y, out screen_x, out screen_y ); + int mouse_x, mouse_y; + + #if HAVE_GTK_3_20 + var seat = Gdk.Display.get_default().get_default_seat(); + seat.get_pointer().get_position(null, out mouse_x, out mouse_y); + #else + double x = 0.0; + double y = 0.0; + + var display = Gdk.Display.get_default(); + var manager = display.get_device_manager(); + GLib.List list = manager.list_devices(Gdk.DeviceType.MASTER); + + foreach(var device in list) { + if (device.input_source != Gdk.InputSource.KEYBOARD) { + Gdk.Screen screen; + device.get_position( out screen, out x, out y ); + } + } + + mouse_x = (int) x; + mouse_y = (int) y; + #endif + + #if HAVE_GTK_3_22 + var monitor = Gdk.Display.get_default().get_monitor_at_point(mouse_x, mouse_y).get_geometry(); + int monitor_x = monitor.width; + int monitor_y = monitor.height; + #else + var screen = Gdk.Screen.get_default().get_root_window(); + int monitor_x = screen.get_width(); + int monitor_y = screen.get_height(); + #endif //reduce the window size if needed to get closer to the actual mouse position int reduce_szx= 1; @@ -255,24 +261,24 @@ public class PieRenderer : GLib.Object { if (mouse_x < sz/2) { if (mouse_y < sz/2) showpie= ShowPieMode.CPIE_TOP_LEFT; //show 1/4 pie - else if (screen_y > 0 && screen_y-mouse_y < sz/2) + else if (monitor_y > 0 && monitor_y-mouse_y < sz/2) showpie= ShowPieMode.CPIE_BOT_LEFT; //show 1/4 pie else showpie= ShowPieMode.HPIE_LEFT; //show 1/2 pie } else if (mouse_y < sz/2) { - if (screen_x > 0 && screen_x-mouse_x < sz/2) + if (monitor_x > 0 && monitor_x-mouse_x < sz/2) showpie= ShowPieMode.CPIE_TOP_RIGHT; //show 1/4 pie else showpie= ShowPieMode.HPIE_TOP; //show 1/2 pie - } else if (screen_x > 0 && screen_x-mouse_x < sz/2) { - if (screen_y > 0 && screen_y-mouse_y < sz/2) + } else if (monitor_x > 0 && monitor_x-mouse_x < sz/2) { + if (monitor_y > 0 && monitor_y-mouse_y < sz/2) showpie= ShowPieMode.CPIE_BOT_RIGHT; //show 1/4 pie else showpie= ShowPieMode.HPIE_RIGHT; //show 1/2 pie - } else if (screen_y > 0 && screen_y-mouse_y < sz/2) + } else if (monitor_y > 0 && monitor_y-mouse_y < sz/2) showpie= ShowPieMode.HPIE_BOTTOM; //show 1/2 pie @@ -288,26 +294,26 @@ public class PieRenderer : GLib.Object { switch( PieManager.get_shape_number(pie.id) ) { case 1: showpie= ShowPieMode.CPIE_BOT_RIGHT; - if (screen_x-mouse_x > sz/2) + if (monitor_x-mouse_x > sz/2) reduce_szx= 0; //keep full width - if (screen_y-mouse_y > sz/2) + if (monitor_y-mouse_y > sz/2) reduce_szy= 0; //keep full height break; case 2: showpie= ShowPieMode.HPIE_RIGHT; - if (screen_x-mouse_x > sz/2) + if (monitor_x-mouse_x > sz/2) reduce_szx= 0; //keep full width break; case 3: showpie= ShowPieMode.CPIE_TOP_RIGHT; - if (screen_x-mouse_x > sz/2) + if (monitor_x-mouse_x > sz/2) reduce_szx= 0; //keep full width if (mouse_y > sz/2) reduce_szy= 0; //keep full height break; case 4: showpie= ShowPieMode.HPIE_BOTTOM; - if (screen_y-mouse_y > sz/2) + if (monitor_y-mouse_y > sz/2) reduce_szy= 0; //keep full height break; case 6: @@ -319,7 +325,7 @@ public class PieRenderer : GLib.Object { showpie= ShowPieMode.CPIE_BOT_LEFT; if (mouse_x > sz/2) reduce_szx= 0; //keep full width - if (screen_y-mouse_y > sz/2) + if (monitor_y-mouse_y > sz/2) reduce_szy= 0; //keep full height break; case 8: diff --git a/src/renderers/pieWindow.vala b/src/renderers/pieWindow.vala index d2bf61f..a5142df 100644 --- a/src/renderers/pieWindow.vala +++ b/src/renderers/pieWindow.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -101,6 +101,12 @@ public class PieWindow : Gtk.Window { private string search_string = ""; + ///////////////////////////////////////////////////////////////////// + /// Used to identify wayland sessions. + ///////////////////////////////////////////////////////////////////// + + private bool wayland = GLib.Environment.get_variable("XDG_SESSION_TYPE") == "wayland"; + ///////////////////////////////////////////////////////////////////// /// C'tor, sets up the window. ///////////////////////////////////////////////////////////////////// @@ -112,7 +118,7 @@ public class PieWindow : Gtk.Window { this.set_skip_taskbar_hint(true); this.set_skip_pager_hint(true); this.set_keep_above(true); - this.set_type_hint(Gdk.WindowTypeHint.POPUP_MENU); + this.set_type_hint(Gdk.WindowTypeHint.DOCK); this.set_decorated(false); this.set_resizable(false); this.icon_name = "gnome-pie"; @@ -186,8 +192,7 @@ public class PieWindow : Gtk.Window { }); this.show.connect_after(() => { - Gtk.grab_add(this); - FocusGrabber.grab(this.get_window(), true, true, false); + FocusGrabber.grab(this.get_window()); }); this.scroll_event.connect((e) => { @@ -209,8 +214,25 @@ public class PieWindow : Gtk.Window { public void load_pie(Pie pie) { this.renderer.load_pie(pie); - this.set_window_position(pie); - this.set_size_request(renderer.size_w, renderer.size_h); + + if (wayland) { + // wayland does not support client side window placement + // therefore we will make a fullscreen window + #if HAVE_GTK_3_22 + var monitor = Gdk.Display.get_default().get_monitor_at_point(this.back_x, this.back_y).get_geometry(); + int monitor_x = monitor.width; + int monitor_y = monitor.height; + #else + var screen = Gdk.Screen.get_default().get_root_window(); + int monitor_x = screen.get_width(); + int monitor_y = screen.get_height(); + #endif + + this.set_size_request(monitor_x, monitor_y); + } else { + this.set_window_position(pie); + this.set_size_request(renderer.size_w, renderer.size_h); + } } ///////////////////////////////////////////////////////////////////// @@ -226,15 +248,22 @@ public class PieWindow : Gtk.Window { this.back_sz_x++; this.back_sz_y++; - int screenx= Gdk.Screen.width(); - int screeny= Gdk.Screen.height(); + #if HAVE_GTK_3_22 + var monitor = Gdk.Display.get_default().get_monitor_at_point(this.back_x, this.back_y).get_geometry(); + int monitor_x = monitor.width; + int monitor_y = monitor.height; + #else + var screen = Gdk.Screen.get_default().get_root_window(); + int monitor_x = screen.get_width(); + int monitor_y = screen.get_height(); + #endif //allow some window movement from the screen borders //(some panels moves the window after it was realized) int dx = this.panel_sz - this.back_x; if (dx > 0) this.back_sz_x += dx; - dx = this.panel_sz - (screenx - this.back_x - this.back_sz_x +1); + dx = this.panel_sz - (monitor_x - this.back_x - this.back_sz_x +1); if (dx > 0) { this.back_sz_x += dx; this.back_x -= dx; @@ -243,7 +272,7 @@ public class PieWindow : Gtk.Window { int dy = this.panel_sz - this.back_y; if (dy > 0) this.back_sz_y += dy; - dy = this.panel_sz - (screeny - this.back_y - this.back_sz_y +1); + dy = this.panel_sz - (monitor_y - this.back_y - this.back_sz_y +1); if (dy > 0) { this.back_sz_y += dy; this.back_y -= dy; @@ -264,10 +293,10 @@ public class PieWindow : Gtk.Window { this.back_sz_y += this.back_y; this.back_y = 0; } - if (this.back_x + this.back_sz_x > screenx) - this.back_sz_x = screenx - this.back_x; - if (this.back_y + this.back_sz_y > screeny) - this.back_sz_y = screeny - this.back_y; + if (this.back_x + this.back_sz_x > monitor_x) + this.back_sz_x = monitor_x - this.back_x; + if (this.back_y + this.back_sz_y > monitor_y) + this.back_sz_y = monitor_y - this.back_y; this.background = new Image.capture_screen(this.back_x, this.back_y, this.back_sz_x, this.back_sz_y); } @@ -314,20 +343,27 @@ public class PieWindow : Gtk.Window { ///////////////////////////////////////////////////////////////////// private void get_mouse_position(out int mx, out int my) { - // get the mouse position - mx = 0; - my = 0; - Gdk.ModifierType mask; - - var display = Gdk.Display.get_default(); - var manager = display.get_device_manager(); - GLib.List list = manager.list_devices(Gdk.DeviceType.MASTER); - - foreach(var device in list) { - if (device.input_source != Gdk.InputSource.KEYBOARD) { - this.get_window().get_device_position(device, out mx, out my, out mask); + #if HAVE_GTK_3_20 + var seat = Gdk.Display.get_default().get_default_seat(); + seat.get_pointer().get_position(null, out mx, out my); + #else + double x = 0.0; + double y = 0.0; + + var display = Gdk.Display.get_default(); + var manager = display.get_device_manager(); + GLib.List list = manager.list_devices(Gdk.DeviceType.MASTER); + + foreach(var device in list) { + if (device.input_source != Gdk.InputSource.KEYBOARD) { + Gdk.Screen screen; + device.get_position( out screen, out x, out y ); + } } - } + + mx = (int) x; + my = (int) y; + #endif } ///////////////////////////////////////////////////////////////////// @@ -335,14 +371,19 @@ public class PieWindow : Gtk.Window { ///////////////////////////////////////////////////////////////////// private void set_mouse_position(int mx, int my) { - var display = Gdk.Display.get_default(); - var manager = display.get_device_manager(); - GLib.List list = manager.list_devices(Gdk.DeviceType.MASTER); - foreach(var device in list) { - if (device.input_source != Gdk.InputSource.KEYBOARD) { - device.warp(Gdk.Screen.get_default(), mx, my); + #if HAVE_GTK_3_20 + var seat = Gdk.Display.get_default().get_default_seat(); + seat.get_pointer().warp(this.screen, mx, my); + #else + var display = Gdk.Display.get_default(); + var manager = display.get_device_manager(); + GLib.List list = manager.list_devices(Gdk.DeviceType.MASTER); + foreach(var device in list) { + if (device.input_source != Gdk.InputSource.KEYBOARD) { + device.warp(Gdk.Screen.get_default(), mx, my); + } } - } + #endif } ///////////////////////////////////////////////////////////////////// @@ -350,6 +391,9 @@ public class PieWindow : Gtk.Window { ///////////////////////////////////////////////////////////////////// private bool draw_window(Cairo.Context ctx) { + int x, y; + this.get_position(out x, out y); + // paint the background image if there is no compositing if (this.has_compositing) { ctx.set_operator (Cairo.Operator.CLEAR); @@ -358,8 +402,6 @@ public class PieWindow : Gtk.Window { } else { //correct the background position if the window was moved //since the background image was captured - int x, y; - this.get_position(out x, out y); int dx = this.back_x - x; int dy = this.back_y - y; ctx.save(); @@ -370,9 +412,6 @@ public class PieWindow : Gtk.Window { ctx.restore(); } - // align the context to the center of the PieWindow - ctx.translate(this.renderer.center_x, this.renderer.center_y); - // get the mouse position int mouse_x, mouse_y; get_mouse_position( out mouse_x, out mouse_y ); @@ -381,9 +420,31 @@ public class PieWindow : Gtk.Window { double frame_time = this.timer.elapsed(); this.timer.reset(); + int center_x = this.renderer.center_x; + int center_y = this.renderer.center_y; + + // on wayland we have a fullscreen window and since we + // do not get the pointer location until the mouse moved + // we can only display the pie centered... + if (this.wayland) { + #if HAVE_GTK_3_22 + var monitor = Gdk.Display.get_default().get_monitor_at_point(mouse_x, mouse_y).get_geometry(); + center_x = monitor.width / 2; + center_y = monitor.height / 2; + #else + var screen = Gdk.Screen.get_default().get_root_window(); + center_x = screen.get_width() / 2; + center_y = screen.get_height() / 2; + #endif + } + + // align the context to the center of the PieWindow + x += center_x; + y += center_y; + ctx.translate(center_x, center_y); + // render the Pie - this.renderer.draw(frame_time, ctx, mouse_x - (int)this.renderer.center_x, - mouse_y - (int)this.renderer.center_y); + this.renderer.draw(frame_time, ctx, mouse_x - x, mouse_y - y); return true; } @@ -396,7 +457,6 @@ public class PieWindow : Gtk.Window { if (!this.closing) { this.closing = true; this.on_closing(); - Gtk.grab_remove(this); FocusGrabber.ungrab(); GLib.Timeout.add(10, () => { @@ -421,7 +481,6 @@ public class PieWindow : Gtk.Window { if (!this.closing) { this.closing = true; this.on_closing(); - Gtk.grab_remove(this); FocusGrabber.ungrab(); this.renderer.cancel(); diff --git a/src/renderers/sliceRenderer.vala b/src/renderers/sliceRenderer.vala index b465bd7..c370b10 100644 --- a/src/renderers/sliceRenderer.vala +++ b/src/renderers/sliceRenderer.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/themes/centerLayer.vala b/src/themes/centerLayer.vala index c4adbb8..8bd61e2 100644 --- a/src/themes/centerLayer.vala +++ b/src/themes/centerLayer.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/themes/sliceLayer.vala b/src/themes/sliceLayer.vala index 1a2c7cd..be196dd 100644 --- a/src/themes/sliceLayer.vala +++ b/src/themes/sliceLayer.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/themes/theme.vala b/src/themes/theme.vala index 9c1ac5c..4a1806d 100644 --- a/src/themes/theme.vala +++ b/src/themes/theme.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/themes/themeImporter.vala b/src/themes/themeImporter.vala index 24db741..5a373a6 100644 --- a/src/themes/themeImporter.vala +++ b/src/themes/themeImporter.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/utilities/animatedValue.vala b/src/utilities/animatedValue.vala index 5bb46f5..3dc0685 100644 --- a/src/utilities/animatedValue.vala +++ b/src/utilities/animatedValue.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/utilities/archiveReader.vala b/src/utilities/archiveReader.vala index 14183ac..df248cf 100644 --- a/src/utilities/archiveReader.vala +++ b/src/utilities/archiveReader.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/utilities/archiveWriter.vala b/src/utilities/archiveWriter.vala index b74b5d0..2a18154 100644 --- a/src/utilities/archiveWriter.vala +++ b/src/utilities/archiveWriter.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/utilities/bindingManager.vala b/src/utilities/bindingManager.vala index a21c0a1..82b6334 100644 --- a/src/utilities/bindingManager.vala +++ b/src/utilities/bindingManager.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -72,6 +72,12 @@ public class BindingManager : GLib.Object { private X.Event? delayed_event = null; private Keybinding? delayed_binding = null; + ///////////////////////////////////////////////////////////////////// + /// Used to identify wayland sessions. + ///////////////////////////////////////////////////////////////////// + + private bool wayland = GLib.Environment.get_variable("XDG_SESSION_TYPE") == "wayland"; + ///////////////////////////////////////////////////////////////////// /// Helper class to store keybinding ///////////////////////////////////////////////////////////////////// @@ -104,7 +110,9 @@ public class BindingManager : GLib.Object { ///////////////////////////////////////////////////////////////////// public void bind(Trigger trigger, string id) { - if (trigger.key_code != 0) { + + // global key grabbing is impossible on wayland + if (!wayland && trigger.key_code != 0) { unowned X.Display display = Gdk.X11.get_default_xdisplay(); X.ID xid = Gdk.X11.get_default_root_xwindow(); @@ -143,8 +151,8 @@ public class BindingManager : GLib.Object { public void unbind(string id) { foreach (var binding in bindings) { if (id == binding.id) { - if (binding.trigger.key_code == 0) { - //no key_code: just remove the bindind from the list + if (binding.trigger.key_code == 0 || wayland) { + //no key_code or wayland: just remove the bindind from the list bindings.remove(binding); return; } diff --git a/src/utilities/color.vala b/src/utilities/color.vala index 1e2baf3..cc65434 100644 --- a/src/utilities/color.vala +++ b/src/utilities/color.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -41,7 +41,7 @@ public class Color: GLib.Object { ///////////////////////////////////////////////////////////////////// public Color() { - Color.from_rgb(1.0f, 1.0f, 1.0f); + this.from_rgb(1.0f, 1.0f, 1.0f); } ///////////////////////////////////////////////////////////////////// @@ -49,7 +49,7 @@ public class Color: GLib.Object { ///////////////////////////////////////////////////////////////////// public Color.from_rgb(float red, float green, float blue) { - Color.from_rgba(red, green, blue, 1.0f); + this.from_rgba(red, green, blue, 1.0f); } ///////////////////////////////////////////////////////////////////// @@ -68,7 +68,7 @@ public class Color: GLib.Object { ///////////////////////////////////////////////////////////////////// public Color.from_gdk(Gdk.RGBA color) { - Color.from_rgba( + this.from_rgba( (float)color.red, (float)color.green, (float)color.blue, @@ -86,7 +86,7 @@ public class Color: GLib.Object { if (!ctx.lookup_color(style_name, out color)) { warning("Failed to get style color for widget style \"" + style_name + "\"!"); } - Color.from_gdk(color); + this.from_gdk(color); } ///////////////////////////////////////////////////////////////////// @@ -96,7 +96,7 @@ public class Color: GLib.Object { public Color.from_string(string hex_string) { var color = Gdk.RGBA(); color.parse(hex_string); - Color.from_gdk(color); + this.from_gdk(color); } ///////////////////////////////////////////////////////////////////// @@ -134,7 +134,7 @@ public class Color: GLib.Object { } } - Color.from_rgb((float)(rtotal/total), (float)(gtotal/total), (float)(btotal/total)); + this.from_rgb((float)(rtotal/total), (float)(gtotal/total), (float)(btotal/total)); if (s > 0.15f) s = 0.65f; diff --git a/src/utilities/config.vala b/src/utilities/config.vala index 3fc8d3f..1d3fde4 100644 --- a/src/utilities/config.vala +++ b/src/utilities/config.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/utilities/focusGrabber.vala b/src/utilities/focusGrabber.vala index 4a3212f..8424f12 100644 --- a/src/utilities/focusGrabber.vala +++ b/src/utilities/focusGrabber.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -28,18 +28,16 @@ public class FocusGrabber : GLib.Object { /// Code roughly from Gnome-Do/Synapse. ///////////////////////////////////////////////////////////////////// - public static void grab(Gdk.Window window, bool keyboard = true, bool pointer = true, bool owner_events = true) { - if (keyboard || pointer) { - window.raise(); - window.focus(Gdk.CURRENT_TIME); - - if (!try_grab_window(window, keyboard, pointer, owner_events)) { - int i = 0; - Timeout.add(100, () => { - if (++i >= 100) return false; - return !try_grab_window(window, keyboard, pointer, owner_events); - }); - } + public static void grab(Gdk.Window window) { + window.raise(); + window.focus(Gdk.CURRENT_TIME); + + if (!try_grab_window(window)) { + int i = 0; + Timeout.add(100, () => { + if (++i >= 100) return false; + return !try_grab_window(window); + }); } } @@ -47,50 +45,65 @@ public class FocusGrabber : GLib.Object { /// Code roughly from Gnome-Do/Synapse. ///////////////////////////////////////////////////////////////////// - public static void ungrab(bool keyboard = true, bool pointer = true) { - var display = Gdk.Display.get_default(); - var manager = display.get_device_manager(); - - GLib.List list = manager.list_devices(Gdk.DeviceType.MASTER); + public static void ungrab() { + #if HAVE_GTK_3_20 + var seat = Gdk.Display.get_default().get_default_seat(); + seat.ungrab(); + #else + var display = Gdk.Display.get_default(); + var manager = display.get_device_manager(); - foreach(var device in list) { - if ((device.input_source == Gdk.InputSource.KEYBOARD && keyboard) - || (device.input_source != Gdk.InputSource.KEYBOARD && pointer)) + GLib.List list = manager.list_devices(Gdk.DeviceType.MASTER); + foreach(var device in list) { device.ungrab(Gdk.CURRENT_TIME); - } + } + #endif } ///////////////////////////////////////////////////////////////////// /// Code roughly from Gnome-Do/Synapse. ///////////////////////////////////////////////////////////////////// - private static bool try_grab_window(Gdk.Window window, bool keyboard, bool pointer, bool owner_events) { - var display = Gdk.Display.get_default(); - var manager = display.get_device_manager(); + private static bool try_grab_window(Gdk.Window window) { + #if HAVE_GTK_3_20 + // try again if window is not yet viewable + if (!window.is_viewable()) return false; - bool grabbed_all = true; + var seat = Gdk.Display.get_default().get_default_seat(); + var caps = Gdk.SeatCapabilities.POINTER | Gdk.SeatCapabilities.KEYBOARD; + var result = seat.grab(window, caps, true, null, null, null); - GLib.List list = manager.list_devices(Gdk.DeviceType.MASTER); + // for some reason GDK hides the window if the grab fails... + if (result != Gdk.GrabStatus.SUCCESS) { + window.show(); + } + + // continue trying to grab if it failed! + return result == Gdk.GrabStatus.SUCCESS; + #else + var display = Gdk.Display.get_default(); + var manager = display.get_device_manager(); - foreach(var device in list) { - if ((device.input_source == Gdk.InputSource.KEYBOARD && keyboard) - || (device.input_source != Gdk.InputSource.KEYBOARD && pointer)) { + bool grabbed_all = true; - var status = device.grab(window, Gdk.GrabOwnership.APPLICATION, owner_events, + GLib.List list = manager.list_devices(Gdk.DeviceType.MASTER); + + foreach(var device in list) { + var status = device.grab(window, Gdk.GrabOwnership.APPLICATION, true, Gdk.EventMask.ALL_EVENTS_MASK, null, Gdk.CURRENT_TIME); if (status != Gdk.GrabStatus.SUCCESS) grabbed_all = false; } - } - if (grabbed_all) - return true; + if (grabbed_all) + return true; - ungrab(keyboard, pointer); + ungrab(); - return false; + return false; + #endif } } diff --git a/src/utilities/key.vala b/src/utilities/key.vala index 432c40e..93e18b5 100644 --- a/src/utilities/key.vala +++ b/src/utilities/key.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/src/utilities/logger.vala b/src/utilities/logger.vala index ecc551e..48f27c6 100644 --- a/src/utilities/logger.vala +++ b/src/utilities/logger.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -29,33 +29,33 @@ public class Logger { /// If these are set to false, the according messages are not shown ///////////////////////////////////////////////////////////////////// - private static const bool display_debug = true; - private static const bool display_warning = true; - private static const bool display_error = true; - private static const bool display_message = true; + private const bool display_debug = true; + private const bool display_warning = true; + private const bool display_error = true; + private const bool display_message = true; ///////////////////////////////////////////////////////////////////// /// If these are set to false, the according messages are not logged ///////////////////////////////////////////////////////////////////// - private static const bool log_debug = false; - private static const bool log_warning = true; - private static const bool log_error = true; - private static const bool log_message = true; + private const bool log_debug = false; + private const bool log_warning = true; + private const bool log_error = true; + private const bool log_message = true; ///////////////////////////////////////////////////////////////////// /// If true, a time stamp is shown in each message. ///////////////////////////////////////////////////////////////////// - private static const bool display_time = false; - private static const bool log_time = true; + private const bool display_time = false; + private const bool log_time = true; ///////////////////////////////////////////////////////////////////// /// If true, the origin of the message is shown. In form file:line ///////////////////////////////////////////////////////////////////// - private static const bool display_file = false; - private static const bool log_file = false; + private const bool display_file = false; + private const bool log_file = false; ///////////////////////////////////////////////////////////////////// /// A regex, used to format the standard message. @@ -67,7 +67,7 @@ public class Logger { /// Limit log and statistics size to roughly 1 MB. ///////////////////////////////////////////////////////////////////// - private static const int max_log_length = 1000000; + private const int max_log_length = 1000000; private static int log_length; diff --git a/src/utilities/paths.vala b/src/utilities/paths.vala index 68c5384..f076ddc 100644 --- a/src/utilities/paths.vala +++ b/src/utilities/paths.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -150,9 +150,7 @@ public class Paths : GLib.Object { Gtk.IconTheme.get_default().append_search_path(path); } - Gtk.IconTheme.get_default().append_search_path("/usr/share/pixmaps/"); - Gtk.IconTheme.get_default().append_search_path("/usr/share/icons/hicolor/scalable/apps"); - Gtk.IconTheme.get_default().append_search_path("/usr/local/share/icons/hicolor/scalable/apps"); + Gtk.IconTheme.get_default().append_search_path(GLib.Environment.get_home_dir() + ".icons"); // get global paths var default_dir = GLib.File.new_for_path("/usr/share/gnome-pie/"); diff --git a/src/utilities/trigger.vala b/src/utilities/trigger.vala index aeed3fb..ac236cd 100644 --- a/src/utilities/trigger.vala +++ b/src/utilities/trigger.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/update_copy_notice.sh b/update_copy_notice.sh index 15eba89..b25872d 100755 --- a/update_copy_notice.sh +++ b/update_copy_notice.sh @@ -3,7 +3,7 @@ shopt -s globstar text="///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2016 by Simon Schneegans +// Copyright (c) 2011-2017 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by -- cgit v1.2.3 From c5369de24ea6e75837b8b99d0b50bbf8cc4b0dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Mon, 24 Jul 2017 20:05:21 +0200 Subject: New README.source to explain the branching model used --- debian/README.source | 18 ++++++++++++++++++ debian/changelog | 7 +++++++ 2 files changed, 25 insertions(+) create mode 100644 debian/README.source diff --git a/debian/README.source b/debian/README.source new file mode 100644 index 0000000..e4f2b3d --- /dev/null +++ b/debian/README.source @@ -0,0 +1,18 @@ +Hello, + +now I use the branching model from Vincent Driessen[1]. + +I use the gitflow-avh[2]. with the Documentation[3]. +The Debian package can be found here[4]. + +Please upload unattended uploads use a branch feature/. + + +Many thanks. + + -- Jörg Frings-Fürst Fri, 02 Jun 2017 19:00:40 +0200 + +[1] http://nvie.com/posts/a-successful-git-branching-model/ +[2] https://github.com/petervanderdoes/gitflow-avh +[3] https://github.com/petervanderdoes/gitflow-avh/wiki +[4] https://tracker.debian.org/pkg/git-flow diff --git a/debian/changelog b/debian/changelog index ecb60c6..6f55f63 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +gnome-pie (0.7.1-1) UNRELEASED; urgency=medium + + * New upstream release. + * New README.source to explain the branching model used. + + -- Jörg Frings-Fürst Mon, 24 Jul 2017 20:02:28 +0200 + gnome-pie (0.7.0-1) unstable; urgency=medium * New upstream release. -- cgit v1.2.3 From 2097a755bfc243a49beb5f9f0b269681085c7d8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Mon, 24 Jul 2017 20:42:12 +0200 Subject: Declare compliance with Debian Policy 4.0.0 --- debian/changelog | 1 + debian/control | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 6f55f63..5b90d41 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ gnome-pie (0.7.1-1) UNRELEASED; urgency=medium * New upstream release. * New README.source to explain the branching model used. + * Declare compliance with Debian Policy 4.0.0. (No changes needed). -- Jörg Frings-Fürst Mon, 24 Jul 2017 20:02:28 +0200 diff --git a/debian/control b/debian/control index 506715a..45f25a1 100644 --- a/debian/control +++ b/debian/control @@ -16,7 +16,7 @@ Build-Depends: libxml2-dev, libxtst-dev, valac (>= 0.24) -Standards-Version: 3.9.8 +Standards-Version: 4.0.0 Homepage: https://gnome-pie.simonschneegans.de/ Vcs-Git: git://anonscm.debian.org/collab-maint/gnome-pie.git Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/gnome-pie.git -- cgit v1.2.3 From 334f925d5866faaf6ed36a4269d14bcc7aa86a76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 25 Jul 2017 06:32:49 +0200 Subject: refresh debian/copyright --- debian/changelog | 1 + debian/copyright | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5b90d41..bb935e4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ gnome-pie (0.7.1-1) UNRELEASED; urgency=medium * New upstream release. * New README.source to explain the branching model used. * Declare compliance with Debian Policy 4.0.0. (No changes needed). + * Refresh debian/copyright. -- Jörg Frings-Fürst Mon, 24 Jul 2017 20:02:28 +0200 diff --git a/debian/copyright b/debian/copyright index ef35bd8..5686c4c 100644 --- a/debian/copyright +++ b/debian/copyright @@ -3,7 +3,7 @@ Upstream-Name: gnome-pie Source: https://github.com/Simmesimme/Gnome-Pie Files: * -Copyright: 2011-2015 Simon Schneegans +Copyright: 2011-2017 Simon Schneegans License: GPL-3.0+ Files: cmake/vala/FindVala.cmake @@ -14,7 +14,7 @@ License: BSD-2-Clause Files: debian/* Copyright: 2011 Alessandro Ghedini - 2014-2015 Jörg Frings-Fürst + 2014-2017 Jörg Frings-Fürst License: GPL-3.0+ License: GPL-3.0+ -- cgit v1.2.3