Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: $desktop variable not changing when switching desktops Linux Mint #1954

Open
devoid1 opened this issue Jun 2, 2024 · 3 comments
Open
Assignees
Labels
bug Bug report or bug fix PR display: x11 Issue related to X11 backend good first issue Great issues for first-time contributors

Comments

@devoid1
Copy link

devoid1 commented Jun 2, 2024

What happened?

i have been upgrading religiously, on 1.21.2 now. running linux mint 21.3. i have an nvidia video card, using nvidia drivers. i noticed suddenly (so i dont know when it started) that the $desktop variable is not changing. if you start conky while on desktop 2 it picks up desktop 2, but that doesnt change when switching desktops.

Version

1.21.2

Which OS/distro are you seeing the problem on?

Ubuntu

Conky config

conky.config = {
 
	background = true,
	update_interval = 1,
	cpu_avg_samples = 2,
	net_avg_samples = 2,

	override_utf8_locale = true,
	double_buffer = true,

	text_buffer_size = 1280,
	imlib_cache_size = 0,

--############################
-- - Window specifications - #
--############################
	own_window_class = 'Conky',
	own_window = true,
	own_window_type = 'desktop',
	own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
	border_inner_margin = 0,
	border_outer_margin = 5,

	own_window_transparent = false,
	own_window_argb_visual = true,
	own_window_argb_value = 175,-- semi-transparent

	minimum_width = 275, minimum_height = 275,
	maximum_width = 275,

	alignment = 'top_right',
	xinerama_head = 1,

--########################
-- - Graphics settings - #
--########################
	draw_shades = false,
	draw_outline = false,
	draw_borders = false,
	draw_graph_borders = true,

	use_xft = true,
	font = 'Liberation Sans:size=11',
	xftalpha = 1,
	total_run_times = 0,
	temperature_unit = 'fahrenheit',
	if_up_strictness = 'address',

--own_window_argb_visual yes
--default_color 656667
	default_shade_color = '#000000',
	default_outline_color = '#828282',

	default_color = '#909090',
	alignment = 'top_right',
	gap_x = 15,
	gap_y = 25,

	uppercase = false,

--########### MPD stuff ################
-- MPD host/port
--	mpd_host = '192.168.1.26',
--	mpd_port = 6600,
--
};

conky.text = [[
S Y S T E M    I N F O   ${goto 170}${font LCDMono:bold:size=11}${color #ddaa00}DESK ${desktop}${font Liberation Sans:size=10}${color #656667}
${color #a0a0a0}${hr}
Host:${color darkgrey}$alignr$nodename${color darkgrey}

Stack trace

No response

Relevant log output

No response

@devoid1 devoid1 added bug Bug report or bug fix PR triage Issue that hasn't been verified labels Jun 2, 2024
@Caellian
Copy link
Collaborator

Caellian commented Jun 5, 2024

This line is responsible for updating desktop number. Not related to nvidia.

My guess is that desktop window type doesn't get notified about the change, which is wrong. Not sure what causes this - likely we don't listen for PropertyNotify events when window type is desktop.

I'll be able to take a closer look in a few weeks because I have midterms (so I'm leaving triage), but try changing window type to normal in the meantime if it works (it should work on most DEs/WMs).

@Caellian Caellian added the display: x11 Issue related to X11 backend label Jun 5, 2024
@devoid1
Copy link
Author

devoid1 commented Jun 6, 2024

changing window type to "normal" causes $desktop variable to be updated correctly. ill run it this way for now. if you need testing at a later date i can help.

@Caellian Caellian self-assigned this Jun 7, 2024
@Caellian
Copy link
Collaborator

Caellian commented Jun 7, 2024

@devoid1 thanks for your offer, but this likely won't need testing - if PropertyNotify can be listened to (some events can't in some cases) it should just work.

I'm self assigning this so I remember to fix it, but it's a good first issue and if someone wants to fix it in the meantime feel free to do so.

To fix, you need to select events for PropertyChangeMask on window.root after this line, and then return true before this line in the event handler if ev.window != window.window. I'm 80% sure this will work.

I currently have a bunch of opened PRs I need to cleanup and get merged before opening a new one.

@Caellian Caellian added good first issue Great issues for first-time contributors and removed triage Issue that hasn't been verified labels Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report or bug fix PR display: x11 Issue related to X11 backend good first issue Great issues for first-time contributors
Projects
None yet
Development

No branches or pull requests

2 participants