Minor cleanups.

This commit is contained in:
byuu
2019-07-28 06:13:48 +09:00
parent e6d7df41da
commit 6b284bb247
4 changed files with 20 additions and 2 deletions

View File

@@ -1,10 +1,20 @@
#if defined(Hiro_Application)
#include <nall/terminal.hpp>
namespace hiro {
auto Log_Ignore(const char* logDomain, GLogLevelFlags logLevel, const char* message, void* userData) -> void {
}
auto Log_Filter(const char* logDomain, GLogLevelFlags logLevel, const char* message, void* userData) -> void {
//FreeBSD 12.0: caused by gtk_combo_box_size_allocate() internal function being defective
if(string{message}.find("gtk_widget_size_allocate():")) return;
//prin all other messages
print(terminal::color::yellow("hiro: "), logDomain, "::", message, "\n");
}
auto pApplication::modal() -> bool {
return Application::state().modal > 0;
}
@@ -92,6 +102,8 @@ auto pApplication::initialize() -> void {
//prevent useless terminal messages:
//GVFS-RemoteVolumeMonitor: "invoking List() failed for type GProxyVolumeMonitorHal: method not implemented"
g_log_set_handler("GVFS-RemoteVolumeMonitor", G_LOG_LEVEL_MASK, Log_Ignore, nullptr);
//Gtk: gtk_widget_size_allocate(): attempt to allocate widget with (width or height < 1)
g_log_set_handler("Gtk", G_LOG_LEVEL_MASK, Log_Filter, nullptr);
//set WM_CLASS to Application::name()
auto name = Application::state().name ? Application::state().name : string{"hiro"};