private void VirtualDesktop_CurrentChanged(object sender, VirtualDesktopChangedEventArgs e) { lock (callbackMutex) { var newDesktop = desktopIdLookup[VirtualDesktop.Current]; Debug.WriteLine("Switched to " + newDesktop); _current = newDesktop; sysTrayProcess.ShowIconForDesktop(Current); MoveStickyWindows(_current); var fgHwnd = WinAPI.GetForegroundWindow(); var lastActiveWindow = activeWindows[Current]; var browserInfo = settings.GetBrowserToActivateInfo(); if (browserInfo != null) { if (lastActiveBrowserWindows[Current] != activeWindows[Current]) { FindActivateBrowserWindow(lastActiveBrowserWindows[Current], browserInfo); } } if (!ActivateWindow(lastActiveWindow)) { Debug.WriteLine("Reactivate " + Current + " " + fgHwnd); WinAPI.SetForegroundWindow(fgHwnd); } movingWindow = IntPtr.Zero; SendSwitchedDesktopMessage(); } }
private void VirtualDesktop_CurrentChanged(object sender, VirtualDesktopChangedEventArgs e) { // 0 == first int currentDesktopIndex = getCurrentDesktopIndex(); changeTrayIcon(currentDesktopIndex); }
private void VirtualDesktop_CurrentChanged(object sender, VirtualDesktopChangedEventArgs e) { int currentDesktopIndex = getCurrentDesktopIndex(); restoreApplicationFocus(currentDesktopIndex); changeTrayIcon(currentDesktopIndex); }
private static void VirtualDesktopOnCurrentChanged(object sender, VirtualDesktopChangedEventArgs e) { Task.Run(() => //VisualHelper.InvokeOnUIDispatcher(() => { if (!Settings.General.ChangeBackgroundEachDesktop) { return; } var desktops = VirtualDesktop.GetDesktops(); var newIndex = Array.IndexOf(desktops, e.NewDesktop) + 1; var dirPath = Settings.General.DesktopBackgroundFolderPath.Value ?? ""; if (Directory.Exists(dirPath)) { foreach (var extension in _supportedExtensions) { var filePath = Path.Combine(dirPath, newIndex + extension); var wallpaper = new FileInfo(filePath); if (wallpaper.Exists) { Set(wallpaper.FullName); break; } } } }); }
private void VirtualDesktopOnCurrentChanged(object sender, VirtualDesktopChangedEventArgs e) { Task.Run(() => { if (!Settings.General.ChangeBackgroundEachDesktop) { return; } var desktops = VirtualDesktop.GetDesktops(); var newNumber = Array.IndexOf(desktops, e.NewDesktop) + 1; var wallpapers = this.GetWallpaperFiles(Settings.General.DesktopBackgroundFolderPath); var files = wallpapers.Where(x => x.DesktopNumber == newNumber).ToArray(); if (files.Length == 0) { var file = wallpapers.SingleOrDefault(x => x.Number == 0); if (file != null) { files = new[] { file } } ; } if (files.Length != 0) { this.Set(files); } }); }
public static void DesktopSwitchedHandler(object sender, VirtualDesktopChangedEventArgs args) { var tDesktops = VirtualDesktop.GetDesktops(); CachedPreviousNumber = Array.IndexOf(tDesktops, args.OldDesktop) + 1; CachedNumber = Array.IndexOf(tDesktops, args.NewDesktop) + 1; }
private void VirtualDesktop_CurrentChanged(object sender, VirtualDesktopChangedEventArgs e) { Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, (Action)(() => { try { this.MoveToDesktop(VirtualDesktop.Current); } catch (InvalidOperationException) { } })); }
private void VirtualDesktop_CurrentChanged(object sender, VirtualDesktopChangedEventArgs e) { // 0 == first int currentDesktopIndex = getCurrentDesktopIndex(); string pictureFile = PickNthFile(currentDesktopIndex); if (pictureFile != null) { Native.SetBackground(pictureFile); } restoreApplicationFocus(currentDesktopIndex); changeTrayIcon(currentDesktopIndex); }
private void VirtualDesktopOnCurrentChanged(object sender, VirtualDesktopChangedEventArgs e) { if (!Settings.General.NotificationWhenSwitchedDesktop) { return; } VisualHelper.InvokeOnUIDispatcher(() => { var desktops = VirtualDesktop.GetDesktops(); var newIndex = Array.IndexOf(desktops, e.NewDesktop) + 1; this._notificationWindow.Disposable = ShowDesktopWindow(newIndex); }); }
private void VirtualDesktopOnCurrentChanged(object sender, VirtualDesktopChangedEventArgs e) { Task.Run(() => { if (!Settings.General.ChangeBackgroundEachDesktop) { return; } var desktops = VirtualDesktop.GetDesktops(); var newIndex = Array.IndexOf(desktops, e.NewDesktop) + 1; var file = this.GetWallpaperFiles(Settings.General.DesktopBackgroundFolderPath).FirstOrDefault(x => x.Number == newIndex); if (file != null) { this.Set(file.Filepath); } }); }
private void VirtualDesktop_CurrentChanged(object sender, VirtualDesktopChangedEventArgs e) { var newDesktop = desktopNumberLookup[e.NewDesktop.Id]; Debug.WriteLine("Switched to " + newDesktop); lock (callbackMutex) { this._current = newDesktop; sysTrayProcess.ShowIconForDesktop(Current); if (VirtualDesktop.Current == e.NewDesktop) { DoActivateBrowser(newDesktop); } else { Debug.WriteLine("Skipped OnDesktopChanged()"); } } }
private void VirtualDesktop_CurrentChanged(object sender, VirtualDesktopChangedEventArgs e) { UpdateDisplay(e.NewDesktop); }
private void VirtualDesktopOnCurrentChanged(object sender, VirtualDesktopChangedEventArgs e) { Utility.Log("Virtual desktop changed!"); }
private void vDeskChanged(object sender, VirtualDesktopChangedEventArgs e) { setNotificationIcon(); }
private void VirtualDesktop_CurrentChanged(object sender, VirtualDesktopChangedEventArgs e) { DWM.GetWindows(); DWM.Draw(); App_Refresh(); }
void IVirtualDesktopNotification.CurrentVirtualDesktopChanged(IVirtualDesktop pDesktopOld, IVirtualDesktop pDesktopNew) { var args = new VirtualDesktopChangedEventArgs(FromComObject(pDesktopOld), FromComObject(pDesktopNew)); CurrentChanged?.Invoke(this, args); }
private void VirtualDesktop_CurrentChanged(object sender, VirtualDesktopChangedEventArgs e) { }
private void OnCurrentDesktopChanged(object sender, VirtualDesktopChangedEventArgs e) { this.Reload(e.NewDesktop); }