-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update GUI more faster on tray icon scroll
- Loading branch information
Showing
5 changed files
with
14 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
[![Build-Ubuntu-latest Actions Status](https://github.com/rozhuk-im/gtk-mixer/workflows/build-ubuntu-latest/badge.svg)](https://github.com/rozhuk-im/gtk-mixer/actions) | ||
|
||
|
||
Rozhuk Ivan <[email protected]> 2020 - 2021 | ||
Rozhuk Ivan <[email protected]> 2020-2022 | ||
|
||
GTK-Mixer is GTK based volume control tool ("mixer").\ | ||
GUI from xfce4-mixer: https://gitlab.xfce.org/apps/xfce4-mixer | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/*- | ||
* Copyright (c) 2021 Rozhuk Ivan <[email protected]> | ||
* Copyright (c) 2021-2022 Rozhuk Ivan <[email protected]> | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -39,14 +39,15 @@ typedef struct gtk_mixer_tray_icon_s { | |
GtkStatusIcon *status_icon; | ||
GtkMenu *menu; | ||
const char *icon_name; | ||
GtkWidget *main_window; | ||
gmp_dev_p dev; | ||
gmp_dev_line_p dev_line; | ||
} gm_tray_icon_t, *gm_tray_icon_p; | ||
|
||
|
||
|
||
static gboolean | ||
gtk_mixer_tray_icon_scroll(GtkStatusIcon *status_icon __unused, | ||
gtk_mixer_tray_icon_scroll(GtkStatusIcon *status_icon, | ||
GdkEventScroll *event, gpointer user_data) { | ||
gm_tray_icon_p tray_icon = user_data; | ||
|
||
|
@@ -63,6 +64,8 @@ gtk_mixer_tray_icon_scroll(GtkStatusIcon *status_icon __unused, | |
tray_icon->dev_line->is_updated = 1; | ||
tray_icon->dev_line->write_required ++; | ||
gmp_dev_write(tray_icon->dev, 0); | ||
gtk_mixer_window_lines_update(tray_icon->main_window); | ||
gtk_mixer_tray_icon_update(status_icon); | ||
break; | ||
default: | ||
break; | ||
|
@@ -171,13 +174,14 @@ gtk_mixer_tray_icon_destroy(GtkWidget *window __unused, gpointer user_data) { | |
} | ||
|
||
GtkStatusIcon * | ||
gtk_mixer_tray_icon_create(void) { | ||
gtk_mixer_tray_icon_create(GtkWidget *main_window) { | ||
gm_tray_icon_p tray_icon; | ||
|
||
tray_icon = calloc(1, sizeof(gm_tray_icon_t)); | ||
if (NULL == tray_icon) | ||
return (NULL); | ||
|
||
tray_icon->main_window = main_window; | ||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS | ||
tray_icon->status_icon = gtk_status_icon_new(); | ||
G_GNUC_END_IGNORE_DEPRECATIONS | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/*- | ||
* Copyright (c) 2020 - 2021 Rozhuk Ivan <[email protected]> | ||
* Copyright (c) 2020-2022 Rozhuk Ivan <[email protected]> | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -162,7 +162,7 @@ on_tray_icon_menu_about_click(GtkMenuItem *menuitem __unused, | |
GtkAboutDialog *dlg = GTK_ABOUT_DIALOG(gtk_about_dialog_new()); | ||
const char *authors[] = { | ||
"", | ||
"2020-2021 Rozhuk Ivan", | ||
"2020-2022 Rozhuk Ivan", | ||
"", | ||
"Original xfce4-mixer", | ||
"2012 Guido Berhoerster", | ||
|
@@ -277,7 +277,7 @@ main(int argc, char **argv) { | |
|
||
|
||
/* Tray icon. */ | ||
app.status_icon = gtk_mixer_tray_icon_create(); | ||
app.status_icon = gtk_mixer_tray_icon_create(app.window); | ||
g_signal_connect(app.status_icon, "activate", | ||
G_CALLBACK(gtk_mixer_status_icon_activate), &app); | ||
g_signal_connect(app.status_icon, "popup-menu", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/*- | ||
* Copyright (c) 2020 - 2021 Rozhuk Ivan <[email protected]> | ||
* Copyright (c) 2020-2022 Rozhuk Ivan <[email protected]> | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -85,7 +85,7 @@ GtkWidget *gtk_mixer_line_create(gmp_dev_p dev, gmp_dev_line_p dev_line); | |
void gtk_mixer_line_update(GtkWidget *container); | ||
|
||
|
||
GtkStatusIcon *gtk_mixer_tray_icon_create(void); | ||
GtkStatusIcon *gtk_mixer_tray_icon_create(GtkWidget *main_window); | ||
void gtk_mixer_tray_icon_dev_set(GtkStatusIcon *status_icon, gmp_dev_p dev); | ||
void gtk_mixer_tray_icon_update(GtkStatusIcon *status_icon); | ||
|
||
|