mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-18 13:54:36 -05:00
Switch to g_{debug,warning} instead of g_log
This commit is contained in:
parent
d2bf704d93
commit
ba9e1fb92a
12 changed files with 80 additions and 68 deletions
|
@ -47,7 +47,8 @@
|
|||
#include "xrmoptions.h"
|
||||
#include "view.h"
|
||||
|
||||
#define LOG_DOMAIN "Dialogs.DMenu"
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "Dialogs.DMenu"
|
||||
|
||||
struct range_pair
|
||||
{
|
||||
|
@ -105,7 +106,7 @@ typedef struct
|
|||
static void async_close_callback ( GObject *source_object, GAsyncResult *res, G_GNUC_UNUSED gpointer user_data )
|
||||
{
|
||||
g_input_stream_close_finish ( G_INPUT_STREAM ( source_object ), res, NULL );
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Closing data stream." );
|
||||
g_debug ( "Closing data stream." );
|
||||
}
|
||||
|
||||
static void read_add ( DmenuModePrivateData * pd, char *data, gsize len )
|
||||
|
@ -157,7 +158,7 @@ static void async_read_callback ( GObject *source_object, GAsyncResult *res, gpo
|
|||
}
|
||||
if ( !g_cancellable_is_cancelled ( pd->cancel ) ) {
|
||||
// Hack, don't use get active.
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Clearing overlay" );
|
||||
g_debug ( "Clearing overlay" );
|
||||
rofi_view_set_overlay ( rofi_view_get_active (), NULL );
|
||||
g_input_stream_close_async ( G_INPUT_STREAM ( stream ), G_PRIORITY_LOW, pd->cancel, async_close_callback, pd );
|
||||
}
|
||||
|
@ -165,7 +166,7 @@ static void async_read_callback ( GObject *source_object, GAsyncResult *res, gpo
|
|||
|
||||
static void async_read_cancel ( G_GNUC_UNUSED GCancellable *cancel, G_GNUC_UNUSED gpointer data )
|
||||
{
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Cancelled the async read." );
|
||||
g_debug ( "Cancelled the async read." );
|
||||
}
|
||||
|
||||
static int get_dmenu_async ( DmenuModePrivateData *pd, int sync_pre_read )
|
||||
|
|
|
@ -48,7 +48,8 @@
|
|||
#include "dialogs/drun.h"
|
||||
|
||||
#define DRUN_CACHE_FILE "rofi2.druncache"
|
||||
#define LOG_DOMAIN "Dialogs.DRun"
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "Dialogs.DRun"
|
||||
|
||||
#define GET_CAT_PARSE_TIME
|
||||
|
||||
|
@ -205,7 +206,7 @@ static gboolean read_desktop_file ( DRunModePrivateData *pd, const char *root, c
|
|||
|
||||
// Check if item is on disabled list.
|
||||
if ( g_hash_table_contains ( pd->disabled_entries, id ) ) {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Skipping: %s, was previously seen.", id );
|
||||
g_debug ( "Skipping: %s, was previously seen.", id );
|
||||
return TRUE;
|
||||
}
|
||||
GKeyFile *kf = g_key_file_new ();
|
||||
|
@ -213,7 +214,7 @@ static gboolean read_desktop_file ( DRunModePrivateData *pd, const char *root, c
|
|||
g_key_file_load_from_file ( kf, path, 0, &error );
|
||||
// If error, skip to next entry
|
||||
if ( error != NULL ) {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Failed to parse desktop file: %s because: %s", path, error->message );
|
||||
g_debug ( "Failed to parse desktop file: %s because: %s", path, error->message );
|
||||
g_error_free ( error );
|
||||
g_key_file_free ( kf );
|
||||
return FALSE;
|
||||
|
@ -222,12 +223,12 @@ static gboolean read_desktop_file ( DRunModePrivateData *pd, const char *root, c
|
|||
gchar *key = g_key_file_get_string ( kf, "Desktop Entry", "Type", NULL );
|
||||
if ( key == NULL ) {
|
||||
// No type? ignore.
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Skipping desktop file: %s because: No type indicated", path );
|
||||
g_debug ( "Skipping desktop file: %s because: No type indicated", path );
|
||||
g_key_file_free ( kf );
|
||||
return FALSE;
|
||||
}
|
||||
if ( g_strcmp0 ( key, "Application" ) ) {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Skipping desktop file: %s because: Not of type application (%s)", path, key );
|
||||
g_debug ( "Skipping desktop file: %s because: Not of type application (%s)", path, key );
|
||||
g_free ( key );
|
||||
g_key_file_free ( kf );
|
||||
return FALSE;
|
||||
|
@ -236,28 +237,28 @@ static gboolean read_desktop_file ( DRunModePrivateData *pd, const char *root, c
|
|||
|
||||
// Name key is required.
|
||||
if ( !g_key_file_has_key ( kf, "Desktop Entry", "Name", NULL ) ) {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Invalid DesktopFile: '%s', no 'Name' key present.\n", path );
|
||||
g_debug ( "Invalid DesktopFile: '%s', no 'Name' key present.\n", path );
|
||||
g_key_file_free ( kf );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Skip hidden entries.
|
||||
if ( g_key_file_get_boolean ( kf, "Desktop Entry", "Hidden", NULL ) ) {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Adding desktop file: %s to disabled list because: Hdden", path );
|
||||
g_debug ( "Adding desktop file: %s to disabled list because: Hdden", path );
|
||||
g_key_file_free ( kf );
|
||||
g_hash_table_add ( pd->disabled_entries, g_strdup ( id ) );
|
||||
return FALSE;
|
||||
}
|
||||
// Skip entries that have NoDisplay set.
|
||||
if ( g_key_file_get_boolean ( kf, "Desktop Entry", "NoDisplay", NULL ) ) {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Adding desktop file: %s to disabled list because: NoDisplay", path );
|
||||
g_debug ( "Adding desktop file: %s to disabled list because: NoDisplay", path );
|
||||
g_key_file_free ( kf );
|
||||
g_hash_table_add ( pd->disabled_entries, g_strdup ( id ) );
|
||||
return FALSE;
|
||||
}
|
||||
// We need Exec, don't support DBusActivatable
|
||||
if ( !g_key_file_has_key ( kf, "Desktop Entry", "Exec", NULL ) ) {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Unsupported DesktopFile: '%s', no 'Exec' key present.\n", path );
|
||||
g_debug ( "Unsupported DesktopFile: '%s', no 'Exec' key present.\n", path );
|
||||
g_key_file_free ( kf );
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -292,7 +293,7 @@ static void walk_dir ( DRunModePrivateData *pd, const char *root, const char *di
|
|||
{
|
||||
DIR *dir;
|
||||
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Checking directory %s for desktop files.", root );
|
||||
g_debug ( "Checking directory %s for desktop files.", root );
|
||||
dir = opendir ( dirname );
|
||||
if ( dir == NULL ) {
|
||||
return;
|
||||
|
|
|
@ -57,7 +57,8 @@
|
|||
#define RUN_CACHE_FILE "rofi-3.runcache"
|
||||
|
||||
/** The log domain of this dialog. */
|
||||
#define LOG_DOMAIN "Dialogs.Run"
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "Dialogs.Run"
|
||||
|
||||
/**
|
||||
* The internal data structure holding the private data of the Run Mode.
|
||||
|
@ -221,7 +222,7 @@ static char ** get_apps ( unsigned int *length )
|
|||
gsize l = 0;
|
||||
gchar *homedir = g_locale_to_utf8 ( g_get_home_dir (), -1, NULL, &l, &error );
|
||||
if ( error != NULL ) {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Failed to convert homedir to UTF-8: %s", error->message );
|
||||
g_debug ( "Failed to convert homedir to UTF-8: %s", error->message );
|
||||
g_clear_error ( &error );
|
||||
g_free ( homedir );
|
||||
return NULL;
|
||||
|
@ -232,13 +233,13 @@ static char ** get_apps ( unsigned int *length )
|
|||
for ( const char *dirname = strtok_r ( path, sep, &strtok_savepointer ); dirname != NULL; dirname = strtok_r ( NULL, sep, &strtok_savepointer ) ) {
|
||||
DIR *dir = opendir ( dirname );
|
||||
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Checking path %s for executable.", dirname );
|
||||
g_debug ( "Checking path %s for executable.", dirname );
|
||||
if ( dir != NULL ) {
|
||||
struct dirent *dent;
|
||||
gsize dirn_len = 0;
|
||||
gchar *dirn = g_locale_to_utf8 ( dirname, -1, NULL, &dirn_len, &error );
|
||||
if ( error != NULL ) {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Failed to convert directory name to UTF-8: %s", error->message );
|
||||
g_debug ( "Failed to convert directory name to UTF-8: %s", error->message );
|
||||
g_clear_error ( &error );
|
||||
closedir ( dir );
|
||||
continue;
|
||||
|
@ -266,7 +267,7 @@ static char ** get_apps ( unsigned int *length )
|
|||
gsize name_len;
|
||||
gchar *name = g_filename_to_utf8 ( dent->d_name, -1, NULL, &name_len, &error );
|
||||
if ( error != NULL ) {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Failed to convert filename to UTF-8: %s", error->message );
|
||||
g_debug ( "Failed to convert filename to UTF-8: %s", error->message );
|
||||
g_clear_error ( &error );
|
||||
g_free ( name );
|
||||
continue;
|
||||
|
|
|
@ -54,7 +54,8 @@
|
|||
* Log domain for the ssh modi.
|
||||
*/
|
||||
|
||||
#define LOG_DOMAIN "Dialogs.Ssh"
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "Dialogs.Ssh"
|
||||
|
||||
/**
|
||||
* Name of the history file where previously choosen hosts are stored.
|
||||
|
@ -266,7 +267,7 @@ static void parse_ssh_config_file ( const char *filename, char ***retv, unsigned
|
|||
{
|
||||
FILE *fd = fopen ( filename, "r" );
|
||||
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Parsing ssh config file: %s", filename );
|
||||
g_debug ( "Parsing ssh config file: %s", filename );
|
||||
if ( fd != NULL ) {
|
||||
char *buffer = NULL;
|
||||
size_t buffer_length = 0;
|
||||
|
@ -287,7 +288,7 @@ static void parse_ssh_config_file ( const char *filename, char ***retv, unsigned
|
|||
|
||||
if ( g_strcmp0 ( token, "Include" ) == 0 ) {
|
||||
token = strtok_r ( NULL, SSH_TOKEN_DELIM, &strtok_pointer );
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Found Include: %s", token );
|
||||
g_debug ( "Found Include: %s", token );
|
||||
gchar *path = rofi_expand_path ( token );
|
||||
gchar *full_path = NULL;
|
||||
if ( !g_path_is_absolute ( path ) ) {
|
||||
|
|
|
@ -56,7 +56,8 @@
|
|||
#define CLIENTSTATE 10
|
||||
#define CLIENTWINDOWTYPE 10
|
||||
|
||||
#define LOG_DOMAIN "Dialogs.Window"
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "Dialogs.Window"
|
||||
|
||||
// a manageable window
|
||||
typedef struct
|
||||
|
|
|
@ -51,7 +51,8 @@
|
|||
#include "rofi.h"
|
||||
#include "view.h"
|
||||
|
||||
#define LOG_DOMAIN "Helper"
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "Helper"
|
||||
|
||||
/**
|
||||
* Textual description of positioning rofi.
|
||||
|
@ -535,8 +536,8 @@ gboolean helper_validate_font ( PangoFontDescription *pfd, const char *font )
|
|||
const char *fam = pango_font_description_get_family ( pfd );
|
||||
int size = pango_font_description_get_size ( pfd );
|
||||
if ( fam == NULL || size == 0 ) {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Pango failed to parse font: '%s'", font );
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Got family: <b>%s</b> at size: <b>%d</b>", fam ? fam : "{unknown}", size );
|
||||
g_debug ( "Pango failed to parse font: '%s'", font );
|
||||
g_debug ( "Got family: <b>%s</b> at size: <b>%d</b>", fam ? fam : "{unknown}", size );
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
|
|
|
@ -75,7 +75,8 @@
|
|||
// TODO: move this check to mode.c
|
||||
#include "mode-private.h"
|
||||
|
||||
#define LOG_DOMAIN "Rofi"
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "Rofi"
|
||||
|
||||
// Pidfile.
|
||||
char *pidfile = NULL;
|
||||
|
@ -179,7 +180,7 @@ static int setup ()
|
|||
*/
|
||||
static void teardown ( int pfd )
|
||||
{
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Teardown" );
|
||||
g_debug ( "Teardown" );
|
||||
// Cleanup font setup.
|
||||
textbox_cleanup ( );
|
||||
|
||||
|
@ -667,7 +668,7 @@ static gboolean main_loop_x11_event_handler ( xcb_generic_event_t *ev, G_GNUC_UN
|
|||
g_main_loop_quit ( main_loop );
|
||||
return G_SOURCE_REMOVE;
|
||||
} else {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_WARNING, "main_loop_x11_event_handler: ev == NULL, status == %d", status );
|
||||
g_warning ( "main_loop_x11_event_handler: ev == NULL, status == %d", status );
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
}
|
||||
|
@ -942,7 +943,7 @@ int main ( int argc, char *argv[] )
|
|||
const char *path = g_get_user_runtime_dir ();
|
||||
if ( path ) {
|
||||
if ( g_mkdir_with_parents ( path, 0700 ) < 0 ) {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_WARNING, "Failed to create user runtime directory: %s with error: %s\n", path, strerror ( errno ) );
|
||||
g_warning ( "Failed to create user runtime directory: %s with error: %s\n", path, strerror ( errno ) );
|
||||
pidfile = g_build_filename ( g_get_home_dir (), ".rofi.pid", NULL );
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
#include "rofi.h"
|
||||
|
||||
/** Logging domain for theme */
|
||||
#define LOG_DOMAIN "Theme"
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "Theme"
|
||||
|
||||
/**
|
||||
* Name of the property type
|
||||
|
@ -372,7 +373,7 @@ static void rofi_theme_resolve_link_property ( Property *p, int depth )
|
|||
// Set name, remove '@' prefix.
|
||||
const char *name = p->value.link.name + 1;
|
||||
if ( depth > 20 ) {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_WARNING, "Found more then 20 redirects for property. Stopping." );
|
||||
g_warning ( "Found more then 20 redirects for property. Stopping." );
|
||||
p->value.link.ref = p;
|
||||
return;
|
||||
}
|
||||
|
@ -419,7 +420,7 @@ Property *rofi_theme_find_property ( ThemeWidget *widget, PropertyType type, con
|
|||
if ( p->type == P_INTEGER && type == P_PADDING ) {
|
||||
return p;
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Found property: '%s' on '%s', but type %s does not match expected type %s.",
|
||||
g_debug ( "Found property: '%s' on '%s', but type %s does not match expected type %s.",
|
||||
property, widget->name,
|
||||
PropertyTypeName[p->type],
|
||||
PropertyTypeName[type]
|
||||
|
@ -448,7 +449,7 @@ int rofi_theme_get_position ( const widget *widget, const char *property, int de
|
|||
if ( p ) {
|
||||
return p->value.i;
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||
return def;
|
||||
}
|
||||
|
||||
|
@ -459,7 +460,7 @@ int rofi_theme_get_integer ( const widget *widget, const char *property, int def
|
|||
if ( p ) {
|
||||
return p->value.i;
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||
return def;
|
||||
}
|
||||
int rofi_theme_get_integer_exact ( const widget *widget, const char *property, int def )
|
||||
|
@ -470,7 +471,7 @@ int rofi_theme_get_integer_exact ( const widget *widget, const char *property, i
|
|||
if ( p ) {
|
||||
return p->value.i;
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||
return def;
|
||||
}
|
||||
|
||||
|
@ -486,7 +487,7 @@ Distance rofi_theme_get_distance ( const widget *widget, const char *property, i
|
|||
return p->value.padding.left;
|
||||
}
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||
return (Distance){ def, PW_PX, SOLID };
|
||||
}
|
||||
|
||||
|
@ -497,7 +498,7 @@ int rofi_theme_get_boolean ( const widget *widget, const char *property, int def
|
|||
if ( p ) {
|
||||
return p->value.b;
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||
return def;
|
||||
}
|
||||
|
||||
|
@ -508,7 +509,7 @@ char *rofi_theme_get_string ( const widget *widget, const char *property, char *
|
|||
if ( p ) {
|
||||
return p->value.s;
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||
return def;
|
||||
}
|
||||
double rofi_theme_get_double ( const widget *widget, const char *property, double def )
|
||||
|
@ -518,7 +519,7 @@ double rofi_theme_get_double ( const widget *widget, const char *property, doubl
|
|||
if ( p ) {
|
||||
return p->value.b;
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||
return def;
|
||||
}
|
||||
void rofi_theme_get_color ( const widget *widget, const char *property, cairo_t *d )
|
||||
|
@ -534,7 +535,7 @@ void rofi_theme_get_color ( const widget *widget, const char *property, cairo_t
|
|||
);
|
||||
}
|
||||
else {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||
}
|
||||
}
|
||||
Padding rofi_theme_get_padding ( const widget *widget, const char *property, Padding pad )
|
||||
|
@ -550,7 +551,7 @@ Padding rofi_theme_get_padding ( const widget *widget, const char *property, Pad
|
|||
return (Padding){ d, d, d, d };
|
||||
}
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||
return pad;
|
||||
}
|
||||
ThemeHighlight rofi_theme_get_highlight ( widget *widget, const char *property, ThemeHighlight th )
|
||||
|
@ -560,7 +561,7 @@ ThemeHighlight rofi_theme_get_highlight ( widget *widget, const char *property,
|
|||
if ( p ) {
|
||||
return p->value.highlight;
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||
g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property );
|
||||
return th;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,8 @@
|
|||
#include "theme.h"
|
||||
|
||||
/** The Rofi View log domain */
|
||||
#define LOG_DOMAIN "View"
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "View"
|
||||
|
||||
#include "xcb.h"
|
||||
/**
|
||||
|
@ -228,7 +229,7 @@ static gboolean rofi_view_repaint ( G_GNUC_UNUSED void * data )
|
|||
// After a resize the edit_pixmap surface might not contain anything anymore.
|
||||
// If we already re-painted, this does nothing.
|
||||
rofi_view_update ( current_active_menu, FALSE );
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "expose event" );
|
||||
g_debug ( "expose event" );
|
||||
TICK_N ( "Expose" );
|
||||
xcb_copy_area ( xcb->connection, CacheState.edit_pixmap, CacheState.main_window, CacheState.gc,
|
||||
0, 0, 0, 0, current_active_menu->width, current_active_menu->height );
|
||||
|
@ -369,7 +370,7 @@ static void rofi_view_window_update_size ( RofiViewState * state )
|
|||
CacheState.edit_surf = cairo_xcb_surface_create ( xcb->connection, CacheState.edit_pixmap, visual, state->width, state->height );
|
||||
CacheState.edit_draw = cairo_create ( CacheState.edit_surf );
|
||||
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Re-size window based internal request: %dx%d.", state->width, state->height );
|
||||
g_debug ( "Re-size window based internal request: %dx%d.", state->width, state->height );
|
||||
// Should wrap main window in a widget.
|
||||
widget_resize ( WIDGET ( state->main_window ), state->width, state->height );
|
||||
}
|
||||
|
@ -412,7 +413,7 @@ void rofi_view_queue_redraw ( void )
|
|||
{
|
||||
if ( current_active_menu && CacheState.repaint_source == 0 ) {
|
||||
CacheState.count++;
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "redraw %llu", CacheState.count );
|
||||
g_debug ( "redraw %llu", CacheState.count );
|
||||
CacheState.repaint_source = g_idle_add_full ( G_PRIORITY_HIGH_IDLE, rofi_view_repaint, NULL, NULL );
|
||||
}
|
||||
}
|
||||
|
@ -434,13 +435,13 @@ void rofi_view_set_active ( RofiViewState *state )
|
|||
g_queue_push_head ( &( CacheState.views ), current_active_menu );
|
||||
// TODO check.
|
||||
current_active_menu = state;
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "stack view." );
|
||||
g_debug ( "stack view." );
|
||||
rofi_view_window_update_size ( current_active_menu );
|
||||
rofi_view_queue_redraw ();
|
||||
return;
|
||||
}
|
||||
else if ( state == NULL && !g_queue_is_empty ( &( CacheState.views ) ) ) {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "pop view." );
|
||||
g_debug ( "pop view." );
|
||||
current_active_menu = g_queue_pop_head ( &( CacheState.views ) );
|
||||
rofi_view_window_update_size ( current_active_menu );
|
||||
rofi_view_queue_redraw ();
|
||||
|
@ -607,7 +608,7 @@ static void rofi_view_setup_fake_transparency ( const char* const fake_backgroun
|
|||
}
|
||||
else {
|
||||
char *fpath = rofi_expand_path ( fake_background );
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Opening %s to use as background.", fpath );
|
||||
g_debug ( "Opening %s to use as background.", fpath );
|
||||
s = cairo_image_surface_create_from_png ( fpath );
|
||||
CacheState.fake_bgrel = TRUE;
|
||||
g_free ( fpath );
|
||||
|
@ -615,7 +616,7 @@ static void rofi_view_setup_fake_transparency ( const char* const fake_backgroun
|
|||
TICK_N ( "Get surface." );
|
||||
if ( s != NULL ) {
|
||||
if ( cairo_surface_status ( s ) != CAIRO_STATUS_SUCCESS ) {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Failed to open surface fake background: %s",
|
||||
g_debug ( "Failed to open surface fake background: %s",
|
||||
cairo_status_to_string ( cairo_surface_status ( s ) ) );
|
||||
cairo_surface_destroy ( s );
|
||||
s = NULL;
|
||||
|
@ -702,7 +703,7 @@ void __create_window ( MenuFlags menu_flags )
|
|||
dpi = ( xcb->screen->height_in_pixels * 25.4 ) / (double) ( xcb->screen->height_in_millimeters );
|
||||
}
|
||||
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Auto-detected DPI: %.2lf", dpi );
|
||||
g_debug ( "Auto-detected DPI: %.2lf", dpi );
|
||||
PangoFontMap *font_map = pango_cairo_font_map_get_default ();
|
||||
pango_cairo_font_map_set_resolution ( (PangoCairoFontMap *) font_map, dpi );
|
||||
}
|
||||
|
@ -931,7 +932,7 @@ void rofi_view_update ( RofiViewState *state, gboolean qr )
|
|||
if ( !widget_need_redraw ( WIDGET ( state->main_window ) ) ) {
|
||||
return;
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Redraw view" );
|
||||
g_debug ( "Redraw view" );
|
||||
TICK ();
|
||||
cairo_t *d = CacheState.edit_draw;
|
||||
cairo_set_operator ( d, CAIRO_OPERATOR_SOURCE );
|
||||
|
@ -1128,7 +1129,7 @@ static void rofi_view_refilter ( RofiViewState *state )
|
|||
state->height = height;
|
||||
rofi_view_calculate_window_position ( state );
|
||||
rofi_view_window_update_size ( state );
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Resize based on re-filter" );
|
||||
g_debug ( "Resize based on re-filter" );
|
||||
}
|
||||
state->refilter = FALSE;
|
||||
TICK_N ( "Filter done" );
|
||||
|
@ -1442,7 +1443,7 @@ void rofi_view_itterrate ( RofiViewState *state, xcb_generic_event_t *ev, xkb_st
|
|||
|
||||
CacheState.edit_surf = cairo_xcb_surface_create ( xcb->connection, CacheState.edit_pixmap, visual, state->width, state->height );
|
||||
CacheState.edit_draw = cairo_create ( CacheState.edit_surf );
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Re-size window based external request: %d %d\n", state->width, state->height );
|
||||
g_debug ( "Re-size window based external request: %d %d\n", state->width, state->height );
|
||||
widget_resize ( WIDGET ( state->main_window ), state->width, state->height );
|
||||
}
|
||||
}
|
||||
|
@ -1733,7 +1734,7 @@ void rofi_view_hide ( void )
|
|||
|
||||
void rofi_view_cleanup ()
|
||||
{
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Cleanup." );
|
||||
g_debug ( "Cleanup." );
|
||||
if ( CacheState.idle_timeout > 0 ) {
|
||||
g_source_remove ( CacheState.idle_timeout );
|
||||
CacheState.idle_timeout = 0;
|
||||
|
@ -1755,7 +1756,7 @@ void rofi_view_cleanup ()
|
|||
CacheState.edit_surf = NULL;
|
||||
}
|
||||
if ( CacheState.main_window != XCB_WINDOW_NONE ) {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Unmapping and free'ing window" );
|
||||
g_debug ( "Unmapping and free'ing window" );
|
||||
xcb_unmap_window ( xcb->connection, CacheState.main_window );
|
||||
xcb_free_gc ( xcb->connection, CacheState.gc );
|
||||
xcb_free_pixmap ( xcb->connection, CacheState.edit_pixmap );
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
#include "widgets/box.h"
|
||||
#include "theme.h"
|
||||
|
||||
#define LOG_DOMAIN "Widgets.Box"
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "Widgets.Box"
|
||||
|
||||
/** Default spacing used in the box*/
|
||||
#define DEFAULT_SPACING 2
|
||||
|
@ -118,7 +119,7 @@ static void vert_calculate_size ( box *b )
|
|||
}
|
||||
if ( b->max_size > rem_height ) {
|
||||
b->max_size = rem_height;
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Widgets to large (height) for box: %d %d", b->max_size, b->widget.h );
|
||||
g_debug ( "Widgets to large (height) for box: %d %d", b->max_size, b->widget.h );
|
||||
return;
|
||||
}
|
||||
if ( active_widgets > 0 ) {
|
||||
|
@ -181,7 +182,7 @@ static void hori_calculate_size ( box *b )
|
|||
b->max_size += MAX ( 0, ( ( active_widgets - 1 ) * spacing ) );
|
||||
if ( b->max_size > ( rem_width ) ) {
|
||||
b->max_size = rem_width;
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Widgets to large (width) for box: %d %d", b->max_size, b->widget.w );
|
||||
g_debug ( "Widgets to large (width) for box: %d %d", b->max_size, b->widget.w );
|
||||
return;
|
||||
}
|
||||
if ( active_widgets > 0 ) {
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
#include "widgets/container.h"
|
||||
#include "theme.h"
|
||||
|
||||
#define LOG_DOMAIN "Widgets.Window"
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "Widgets.Window"
|
||||
|
||||
struct _window
|
||||
{
|
||||
|
|
|
@ -54,7 +54,8 @@
|
|||
#include "xkb-internal.h"
|
||||
|
||||
/** Log domain for this module */
|
||||
#define LOG_DOMAIN "X11Helper"
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "X11Helper"
|
||||
|
||||
WindowManager current_window_manager = WM_EWHM;
|
||||
|
||||
|
@ -286,14 +287,14 @@ void x11_build_monitor_layout ()
|
|||
if ( !x11_is_extension_present ( "RANDR" ) ) {
|
||||
// Check if xinerama is available.
|
||||
if ( x11_is_extension_present ( "XINERAMA" ) ) {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Query XINERAMA for monitor layout." );
|
||||
g_debug ( "Query XINERAMA for monitor layout." );
|
||||
x11_build_monitor_layout_xinerama ();
|
||||
return;
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "No RANDR or Xinerama available for getting monitor layout." );
|
||||
g_debug ( "No RANDR or Xinerama available for getting monitor layout." );
|
||||
return;
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Query RANDR for monitor layout." );
|
||||
g_debug ( "Query RANDR for monitor layout." );
|
||||
|
||||
xcb_randr_get_screen_resources_current_reply_t *res_reply;
|
||||
xcb_randr_get_screen_resources_current_cookie_t src;
|
||||
|
@ -490,7 +491,7 @@ static int monitor_active_from_id ( int mon_id, workarea *mon )
|
|||
// This is our give up point.
|
||||
return FALSE;
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Failed to find monitor, fall back to monitor showing mouse." );
|
||||
g_debug ( "Failed to find monitor, fall back to monitor showing mouse." );
|
||||
return monitor_active_from_id ( -5, mon );
|
||||
}
|
||||
|
||||
|
@ -815,7 +816,7 @@ xcb_window_t xcb_stuff_get_root_window ( xcb_stuff *xcb )
|
|||
void xcb_stuff_wipe ( xcb_stuff *xcb )
|
||||
{
|
||||
if ( xcb->connection != NULL ) {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Cleaning up XCB and XKB" );
|
||||
g_debug ( "Cleaning up XCB and XKB" );
|
||||
if ( xcb->sncontext != NULL ) {
|
||||
sn_launchee_context_unref ( xcb->sncontext );
|
||||
xcb->sncontext = NULL;
|
||||
|
@ -871,7 +872,7 @@ void x11_helper_discover_window_manager ( void )
|
|||
xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_name_unchecked ( &( xcb->ewmh ), wm_win );
|
||||
if ( xcb_ewmh_get_wm_name_reply ( &( xcb->ewmh ), cookie, &wtitle, (void *) 0 ) ) {
|
||||
if ( wtitle.strings_len > 0 ) {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Found window manager: %s", wtitle.strings );
|
||||
g_debug ( "Found window manager: %s", wtitle.strings );
|
||||
if ( g_strcmp0 ( wtitle.strings, "i3" ) == 0 ) {
|
||||
current_window_manager = WM_I3;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue