fix: Linux visibleOnAllWorkspaces property (#46861)
		
	* test: do not skip visibleOnAllWorkspaces tests on Windows That feature is supported on Linux, so move the test from the "window states (excluding Linux)" section into the "window states" section. Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> * chore: disable visibleOnAllWorkspaces test on Linux Co-authored-by: Charles Kerr <charles@charleskerr.com> * fix: NativeWindowViews::IsVisibleOnAllWorkspaces Co-authored-by: Charles Kerr <charles@charleskerr.com> * test: enable visibleOnAllWorkspaces tests on Linux Co-authored-by: Charles Kerr <charles@charleskerr.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
		
					parent
					
						
							
								afee4a78f2
							
						
					
				
			
			
				commit
				
					
						bdde668926
					
				
			
		
					 2 changed files with 8 additions and 2 deletions
				
			
		| 
						 | 
					@ -1522,6 +1522,13 @@ void NativeWindowViews::SetVisibleOnAllWorkspaces(
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool NativeWindowViews::IsVisibleOnAllWorkspaces() const {
 | 
					bool NativeWindowViews::IsVisibleOnAllWorkspaces() const {
 | 
				
			||||||
 | 
					  // NB: Electron >= 37 has a better long-term fix, but it also has an edge
 | 
				
			||||||
 | 
					  // case which is a breaking change. The code here is dirtier (e.g. accessing
 | 
				
			||||||
 | 
					  // a method marked as private) to avoid that edge case. More info @
 | 
				
			||||||
 | 
					  // https://github.com/electron/electron/pull/46834#issuecomment-2836287699
 | 
				
			||||||
 | 
					  if (const auto* view_native_widget = widget()->native_widget_private())
 | 
				
			||||||
 | 
					    return view_native_widget->IsVisibleOnAllWorkspaces();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if BUILDFLAG(IS_LINUX)
 | 
					#if BUILDFLAG(IS_LINUX)
 | 
				
			||||||
  if (IsX11()) {
 | 
					  if (IsX11()) {
 | 
				
			||||||
    // Use the presence/absence of _NET_WM_STATE_STICKY in _NET_WM_STATE to
 | 
					    // Use the presence/absence of _NET_WM_STATE_STICKY in _NET_WM_STATE to
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5407,8 +5407,7 @@ describe('BrowserWindow module', () => {
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // FIXME: enable this test on Linux as well.
 | 
					    ifdescribe(process.platform !== 'win32')('visibleOnAllWorkspaces state', () => {
 | 
				
			||||||
    ifdescribe(process.platform === 'darwin')('visibleOnAllWorkspaces state', () => {
 | 
					 | 
				
			||||||
      describe('with properties', () => {
 | 
					      describe('with properties', () => {
 | 
				
			||||||
        it('can be changed', () => {
 | 
					        it('can be changed', () => {
 | 
				
			||||||
          const w = new BrowserWindow({ show: false });
 | 
					          const w = new BrowserWindow({ show: false });
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue