Skip to content

Commit e9e8d1a

Browse files
marsch84flexiondotorg
authored andcommitted
Disables the checking function has_gpu_screen. The function did not fulfill its purpose.
The tag 'name:NVIDIA-G' only appears in 'xrandr --listproviders', when on-demand has already been enabled. If nvidia or intel are enabled, it does not appear. As a consequence the option is only listed in the drop down menu, when it is active. There was no chance to select it, if this was not the case. Not sure whether there is another option to check, whether on-demand is actually supported by the running X-server. Nevertheless, this implementation did not serve its purpose.
1 parent 5a36478 commit e9e8d1a

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

usr/bin/mate-optimus-applet

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,6 @@ def nvidia_detected(capability):
7474
print(' - nvidia-detector: Skipped')
7575
return True
7676

77-
def has_gpu_screen(capability):
78-
if capability == 'on-demand':
79-
providers = subprocess.Popen(['xrandr', '--listproviders'], stdout=PIPE, stderr=DEVNULL)
80-
for line in providers.stdout.readlines():
81-
text = line.rstrip().decode('utf-8')
82-
if 'name:NVIDIA-G' in text:
83-
print(' - xrandr: NVIDIA GPU screen detected.')
84-
return True
85-
print(' - xrandr: NVIDIA GPU screen not detected.')
86-
return False
87-
else:
88-
print(' - xrandr: NVIDIA GPU screen check skipped.')
89-
return True
90-
9177
def gpu_loaded(gpu):
9278
# Does prime-switch report that the GPU is available?
9379
if gpu == 'intel' or gpu == 'amdgpu' or gpu == 'radeon':
@@ -123,8 +109,7 @@ def check_capability(capability):
123109
if gpu_loaded(capability) and \
124110
prime_capable() and \
125111
nvidia_detected(capability) and \
126-
prime_select_features(capability) and \
127-
has_gpu_screen(capability):
112+
prime_select_features(capability):
128113
print(' - ' + capability + ': is supported')
129114
return True
130115
else:

0 commit comments

Comments
 (0)