Thu, 26 Mar 2020 20:23:10 -0500
Add a null check to the ui_info unref in jabber
| 14286 | 1 | /* |
| 15884 | 2 | * purple - WinPurple Options Plugin |
| 14286 | 3 | * |
| 4 | * File: gtkappbar.c | |
| 5 | * Date: August 2, 2003 | |
| 6 | * Description: Appbar functionality for Windows GTK+ applications | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
7 | * |
| 14286 | 8 | * Copyright (C) 2003, Herman Bloggs <hermanator12002@yahoo.com> |
| 9 | * | |
| 10 | * This program is free software; you can redistribute it and/or modify | |
| 11 | * it under the terms of the GNU General Public License as published by | |
| 12 | * the Free Software Foundation; either version 2 of the License, or | |
| 13 | * (at your option) any later version. | |
| 14 | * | |
| 15 | * This program is distributed in the hope that it will be useful, | |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 18 | * GNU General Public License for more details. | |
| 19 | * | |
| 20 | * You should have received a copy of the GNU General Public License | |
| 21 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19395
diff
changeset
|
22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 14286 | 23 | * |
| 24 | */ | |
| 25 | /* | |
| 26 | * TODO: | |
| 27 | * - Move 'App on top' feature from Trans plugin to here | |
| 28 | * - Bug: Multiple Show/Hide Desktop calls causes client area to disappear | |
| 29 | */ | |
| 30 | #include <windows.h> | |
| 31 | #include <winver.h> | |
| 32 | #include <stdio.h> | |
| 33 | #include <gtk/gtk.h> | |
| 34 | #include <gdk/gdkwin32.h> | |
| 35 | #include "gtkappbar.h" | |
| 36 | #include "debug.h" | |
| 37 | ||
| 38 | #define APPBAR_CALLBACK WM_USER + 1010 | |
| 39 | ||
| 15884 | 40 | typedef HMONITOR WINAPI purple_MonitorFromPoint(POINT, DWORD); |
| 41 | typedef HMONITOR WINAPI purple_MonitorFromWindow(HWND, DWORD); | |
| 42 | typedef BOOL WINAPI purple_GetMonitorInfo(HMONITOR, LPMONITORINFO); | |
| 14286 | 43 | |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
44 | static void gtk_appbar_do_dock(GtkAppBar *ab, UINT side); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
45 | |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
46 | static inline HWND |
|
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
47 | appbar_get_handle(GtkAppBar *ab) |
|
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
48 | { |
|
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
49 | return GDK_WINDOW_HWND(gtk_widget_get_window(ab->win)); |
|
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
50 | } |
|
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
51 | |
| 14286 | 52 | /* Retrieve the rectangular display area from the specified monitor |
| 53 | * Return TRUE if successful, otherwise FALSE | |
| 54 | */ | |
| 55 | static gboolean | |
| 56 | get_rect_from_monitor(HMODULE hmod, HMONITOR monitor, RECT *rect) { | |
| 15884 | 57 | purple_GetMonitorInfo *the_GetMonitorInfo; |
| 14286 | 58 | MONITORINFO info; |
| 59 | ||
| 15884 | 60 | if (!(the_GetMonitorInfo = (purple_GetMonitorInfo*) |
| 14286 | 61 | GetProcAddress(hmod, "GetMonitorInfoA"))) { |
| 62 | return FALSE; | |
| 63 | } | |
| 64 | ||
| 65 | info.cbSize = sizeof(info); | |
| 66 | if (!the_GetMonitorInfo(monitor, &info)) { | |
| 67 | return FALSE; | |
| 68 | } | |
| 69 | ||
| 70 | CopyRect(rect, &(info.rcMonitor)); | |
| 71 | ||
| 72 | return TRUE; | |
| 73 | } | |
| 74 | ||
| 75 | /** | |
| 76 | * This will only work on Win98+ and Win2K+ | |
| 77 | * Return TRUE if successful, otherwise FALSE | |
| 78 | */ | |
| 79 | static gboolean | |
| 80 | get_rect_at_point_multimonitor(POINT pt, RECT *rect) { | |
| 81 | HMODULE hmod; | |
| 15884 | 82 | purple_MonitorFromPoint *the_MonitorFromPoint; |
| 14286 | 83 | HMONITOR monitor; |
| 84 | ||
| 85 | if (!(hmod = GetModuleHandle("user32"))) { | |
| 86 | return FALSE; | |
| 87 | } | |
| 88 | ||
| 15884 | 89 | if (!(the_MonitorFromPoint = (purple_MonitorFromPoint*) |
| 14286 | 90 | GetProcAddress(hmod, "MonitorFromPoint"))) { |
| 91 | return FALSE; | |
| 92 | } | |
| 93 | ||
| 94 | monitor = | |
| 95 | the_MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY); | |
| 96 | ||
| 97 | return get_rect_from_monitor(hmod, monitor, rect); | |
| 98 | } | |
| 99 | ||
| 100 | /** | |
| 101 | * This will only work on Win98+ and Win2K+ | |
| 102 | * Return TRUE if successful, otherwise FALSE | |
| 103 | */ | |
| 104 | static gboolean | |
| 105 | get_rect_of_window_multimonitor(HWND window, RECT *rect) { | |
| 106 | HMODULE hmod; | |
| 15884 | 107 | purple_MonitorFromWindow *the_MonitorFromWindow; |
| 14286 | 108 | HMONITOR monitor; |
| 109 | ||
| 110 | if (!(hmod = GetModuleHandle("user32"))) { | |
| 111 | return FALSE; | |
| 112 | } | |
| 113 | ||
| 15884 | 114 | if (!(the_MonitorFromWindow = (purple_MonitorFromWindow*) |
| 14286 | 115 | GetProcAddress(hmod, "MonitorFromWindow"))) { |
| 116 | return FALSE; | |
| 117 | } | |
| 118 | ||
| 119 | monitor = | |
| 120 | the_MonitorFromWindow(window, MONITOR_DEFAULTTOPRIMARY); | |
| 121 | ||
| 122 | return get_rect_from_monitor(hmod, monitor, rect); | |
| 123 | } | |
| 124 | ||
| 125 | /* | |
| 126 | * Fallback if cannot get the RECT from the monitor directly | |
| 127 | */ | |
| 128 | static void get_default_workarea(RECT *rect) { | |
| 129 | if (!SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, FALSE)) { | |
| 130 | /* I don't think this will ever happen */ | |
| 131 | rect->left = 0; | |
| 132 | rect->top = 0; | |
| 133 | rect->bottom = GetSystemMetrics(SM_CYSCREEN); | |
| 134 | rect->right = GetSystemMetrics(SM_CXSCREEN); | |
| 135 | } | |
| 136 | } | |
| 137 | ||
| 138 | /* Retrieve the rectangle of the active work area at a point */ | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
139 | static void get_rect_at_point(POINT pt, RECT *rc) { |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
140 | if (!get_rect_at_point_multimonitor(pt, rc)) { |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
141 | get_default_workarea(rc); |
| 14286 | 142 | } |
| 143 | } | |
| 144 | ||
| 145 | /* Retrieve the rectangle of the active work area of a window*/ | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
146 | static void get_rect_of_window(HWND window, RECT *rc) { |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
147 | if (!get_rect_of_window_multimonitor(window, rc)) { |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
148 | get_default_workarea(rc); |
| 14286 | 149 | } |
| 150 | } | |
| 151 | ||
| 152 | static void get_window_normal_rc(HWND hwnd, RECT *rc) { | |
| 153 | WINDOWPLACEMENT wplc; | |
| 154 | GetWindowPlacement(hwnd, &wplc); | |
| 155 | CopyRect(rc, &wplc.rcNormalPosition); | |
| 156 | } | |
| 157 | #if 0 | |
| 158 | static void print_rect(RECT *rc) { | |
| 15884 | 159 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "RECT: L:%ld R:%ld T:%ld B:%ld\n", |
| 14286 | 160 | rc->left, rc->right, rc->top, rc->bottom); |
| 161 | } | |
| 162 | #endif | |
| 163 | /** Set the window style to be the "Tool Window" style - small header, no min/max buttons */ | |
| 164 | static void set_toolbar(HWND hwnd, gboolean val) { | |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
165 | LONG style = GetWindowLong(hwnd, GWL_EXSTYLE); |
| 14286 | 166 | |
| 167 | if(val && !(style & WS_EX_TOOLWINDOW)) | |
| 168 | style |= WS_EX_TOOLWINDOW; | |
| 169 | else if(!val && style & WS_EX_TOOLWINDOW) | |
| 170 | style &= ~WS_EX_TOOLWINDOW; | |
| 171 | else | |
| 172 | return; | |
| 173 | SetWindowLong(hwnd, GWL_EXSTYLE, style); | |
| 174 | SetWindowPos(hwnd, 0, 0, 0, 0, 0, | |
| 175 | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
25910
diff
changeset
|
176 | |
| 14286 | 177 | /* This really should be the following, but SWP_FRAMECHANGED strangely causes initermittent problems "Show Desktop" done more than once. |
| 178 | * Not having SWP_FRAMECHANGED *should* cause the Style not to be applied, but i haven't noticed any problems | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
179 | * SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); |
| 14286 | 180 | */ |
| 181 | } | |
| 182 | /** Register the window as an appbar */ | |
| 183 | static gboolean gtk_appbar_register(GtkAppBar *ab, HWND hwnd) { | |
| 184 | APPBARDATA abd; | |
| 185 | ||
| 186 | abd.cbSize = sizeof(APPBARDATA); | |
| 187 | abd.hWnd = hwnd; | |
| 188 | abd.uCallbackMessage = APPBAR_CALLBACK; | |
| 189 | ||
| 190 | ab->registered = SHAppBarMessage(ABM_NEW, &abd); | |
| 191 | ||
| 192 | return ab->registered; | |
| 193 | } | |
| 194 | /** Unregister the window as an appbar */ | |
| 195 | static gboolean gtk_appbar_unregister(GtkAppBar *ab, HWND hwnd) { | |
| 196 | APPBARDATA abd; | |
| 197 | ||
| 198 | if(!ab->registered) | |
| 199 | return TRUE; | |
| 200 | ||
| 201 | abd.cbSize = sizeof(APPBARDATA); | |
| 202 | abd.hWnd = hwnd; | |
| 203 | ||
| 204 | SHAppBarMessage(ABM_REMOVE, &abd); /** This always returns TRUE */ | |
| 205 | ||
| 206 | ab->registered = FALSE; | |
| 207 | ||
| 208 | ab->docked = FALSE; | |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
209 | ab->undocking = FALSE; |
| 14286 | 210 | ab->docking = FALSE; |
| 211 | ||
| 212 | return TRUE; | |
| 213 | } | |
| 214 | ||
| 215 | static void gtk_appbar_querypos(GtkAppBar *ab, HWND hwnd, RECT rcWorkspace) { | |
| 216 | APPBARDATA abd; | |
| 217 | guint iWidth = 0; | |
| 218 | ||
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
219 | if(!ab->registered) |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
220 | gtk_appbar_register(ab, hwnd); |
| 14286 | 221 | |
| 222 | abd.hWnd = hwnd; | |
| 223 | abd.cbSize = sizeof(APPBARDATA); | |
| 224 | abd.uEdge = ab->side; | |
| 225 | ||
| 226 | iWidth = ab->docked_rect.right - ab->docked_rect.left; | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
227 | |
| 14286 | 228 | abd.rc.top = rcWorkspace.top; |
| 229 | abd.rc.bottom = rcWorkspace.bottom; | |
| 230 | switch (abd.uEdge) | |
| 231 | { | |
| 232 | case ABE_LEFT: | |
| 233 | abd.rc.left = rcWorkspace.left; | |
| 234 | abd.rc.right = rcWorkspace.left + iWidth; | |
| 235 | break; | |
| 236 | ||
| 237 | case ABE_RIGHT: | |
| 238 | abd.rc.right = rcWorkspace.right; | |
| 239 | abd.rc.left = rcWorkspace.right - iWidth; | |
| 240 | break; | |
| 241 | } | |
| 242 | ||
| 243 | /* Ask the system for the screen space */ | |
| 244 | SHAppBarMessage(ABM_QUERYPOS, &abd); | |
| 245 | ||
| 246 | switch (abd.uEdge) | |
| 247 | { | |
| 248 | case ABE_LEFT: | |
| 249 | abd.rc.right = abd.rc.left + iWidth; | |
| 250 | break; | |
| 251 | ||
| 252 | case ABE_RIGHT: | |
| 253 | abd.rc.left = abd.rc.right - iWidth; | |
| 254 | break; | |
| 255 | } | |
| 256 | ||
| 257 | CopyRect(&(ab->docked_rect), &abd.rc); | |
| 258 | } | |
| 259 | /* Actually set the size and screen location of the appbar */ | |
| 260 | static void gtk_appbar_setpos(GtkAppBar *ab, HWND hwnd) { | |
| 261 | APPBARDATA abd; | |
| 262 | ||
| 263 | if(!ab->registered) | |
| 264 | gtk_appbar_register(ab, hwnd); | |
| 265 | ||
| 266 | abd.hWnd = hwnd; | |
| 267 | abd.cbSize = sizeof(APPBARDATA); | |
| 268 | CopyRect(&abd.rc, &(ab->docked_rect)); | |
| 269 | abd.uEdge = ab->side; | |
| 270 | ||
| 271 | SHAppBarMessage(ABM_SETPOS, &abd); | |
| 272 | } | |
| 273 | /** Let any callbacks know that we have docked or undocked */ | |
| 274 | static void gtk_appbar_dispatch_dock_cbs(GtkAppBar *ab, gboolean val) { | |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
275 | GSList *lst = ab->dock_cbs; |
| 14286 | 276 | |
| 277 | while(lst) { | |
| 278 | GtkAppBarDockCB dock_cb = lst->data; | |
| 279 | dock_cb(val); | |
| 280 | lst = lst->next; | |
| 281 | } | |
| 282 | } | |
| 283 | ||
| 284 | static GdkFilterReturn wnd_moving(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 285 | MSG *msg = (MSG*)xevent; | |
| 286 | POINT cp; | |
| 287 | RECT *rc = (RECT*)msg->lParam; | |
| 288 | RECT monRect; | |
| 289 | int side = -1; | |
| 290 | long dockAreaWidth = 0; | |
| 291 | ||
| 15884 | 292 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_moving\n"); |
| 14286 | 293 | |
| 294 | GetCursorPos(&cp); | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
295 | get_rect_at_point(cp, &monRect); |
| 14286 | 296 | |
| 297 | dockAreaWidth = (monRect.right - monRect.left) / 10; | |
| 298 | /* Which part of the screen are we in ? */ | |
| 299 | if (cp.x > (monRect.right - dockAreaWidth)) { | |
| 300 | side = ABE_RIGHT; | |
| 301 | } else if (cp.x < (monRect.left + dockAreaWidth)) { | |
| 302 | side = ABE_LEFT; | |
| 303 | } | |
| 304 | ||
| 305 | if(!ab->docked) { | |
| 306 | if( (side == ABE_RIGHT || side == ABE_LEFT) ) { | |
| 307 | if( !ab->docking ) { | |
| 308 | ab->side = side; | |
| 309 | GetWindowRect(msg->hwnd, &(ab->docked_rect)); | |
| 310 | gtk_appbar_querypos(ab, msg->hwnd, monRect); | |
| 311 | ||
| 312 | /* save pre-docking height */ | |
| 313 | ab->undocked_height = rc->bottom - rc->top; | |
| 314 | ab->docking = TRUE; | |
| 315 | } | |
| 316 | } | |
| 317 | else | |
| 318 | ab->docking = FALSE; | |
| 319 | } | |
| 320 | else if(side < 0) { | |
| 321 | gtk_appbar_unregister(ab, msg->hwnd); | |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
322 | ab->undocking = TRUE; |
| 14286 | 323 | rc->bottom = rc->top + ab->undocked_height; |
| 324 | } | |
| 325 | ||
| 326 | return GDK_FILTER_CONTINUE; | |
| 327 | } | |
| 328 | ||
| 329 | static GdkFilterReturn wnd_sizing(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 330 | MSG *msg = (MSG*)xevent; | |
| 331 | ||
| 15884 | 332 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_sizing\n"); |
| 14286 | 333 | if(ab->docked) { |
| 334 | RECT *rc = (RECT*)msg->lParam; | |
| 335 | if(ab->side == ABE_LEFT && msg->wParam == WMSZ_RIGHT) { | |
| 336 | ab->docked_rect.right = rc->right; | |
| 337 | gtk_appbar_setpos(ab, msg->hwnd); | |
| 338 | } | |
| 339 | else if(ab->side == ABE_RIGHT && msg->wParam == WMSZ_LEFT) { | |
| 340 | ab->docked_rect.left = rc->left; | |
| 341 | gtk_appbar_setpos(ab, msg->hwnd); | |
| 342 | } | |
| 343 | return GDK_FILTER_REMOVE; | |
| 344 | } | |
| 345 | return GDK_FILTER_CONTINUE; | |
| 346 | } | |
| 347 | /** Notify the system that the appbar has been activated */ | |
| 348 | static GdkFilterReturn wnd_activate(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 349 | if (ab->registered) { | |
| 350 | APPBARDATA abd; | |
| 351 | MSG *msg = (MSG*)xevent; | |
| 15884 | 352 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_activate\n"); |
| 14286 | 353 | |
| 354 | abd.hWnd = msg->hwnd; | |
| 355 | abd.cbSize = sizeof(APPBARDATA); | |
| 356 | ||
| 357 | SHAppBarMessage(ABM_ACTIVATE, &abd); | |
| 358 | } | |
| 359 | return GDK_FILTER_CONTINUE; | |
| 360 | } | |
|
20846
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
361 | |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
362 | static void show_hide(GtkAppBar *ab, gboolean hide) { |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
363 | purple_debug_info("gtkappbar", "show_hide(%d)\n", hide); |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
364 | |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
365 | if (hide) { |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
366 | purple_debug_info("gtkappbar", "hidden\n"); |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
367 | gtk_appbar_unregister(ab, appbar_get_handle(ab)); |
|
20846
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
368 | ab->docked = TRUE; |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
369 | ab->iconized = TRUE; |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
370 | } else { |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
371 | ab->iconized = FALSE; |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
372 | purple_debug_info("gtkappbar", "shown\n"); |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
373 | ab->docked = FALSE; |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
374 | gtk_appbar_do_dock(ab, ab->side); |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
375 | } |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
376 | |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
377 | } |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
378 | |
| 14286 | 379 | /** Notify the system that the appbar's position has changed */ |
| 380 | static GdkFilterReturn wnd_poschanged(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 381 | if (ab->registered) { | |
| 382 | APPBARDATA abd; | |
| 383 | MSG *msg = (MSG*)xevent; | |
|
20846
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
384 | |
|
25910
d24c4a9d28f2
Changing debug levels. These messages fire every single time a window changes focus, making debugging anything else impossible
Casey Ho <caseyho@pidgin.im>
parents:
20846
diff
changeset
|
385 | purple_debug(PURPLE_DEBUG_MISC, "gtkappbar", "wnd_poschanged\n"); |
| 14286 | 386 | |
| 387 | abd.hWnd = msg->hwnd; | |
| 388 | abd.cbSize = sizeof(APPBARDATA); | |
| 389 | ||
| 390 | SHAppBarMessage(ABM_WINDOWPOSCHANGED, &abd); | |
|
20846
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
391 | |
| 14286 | 392 | } |
| 393 | return GDK_FILTER_CONTINUE; | |
| 394 | } | |
| 395 | /** The window is about to change */ | |
| 396 | static GdkFilterReturn wnd_poschanging(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 397 | MSG *msg = (MSG*)xevent; | |
| 398 | WINDOWPOS *wpos = (WINDOWPOS*)msg->lParam; | |
| 399 | ||
|
25910
d24c4a9d28f2
Changing debug levels. These messages fire every single time a window changes focus, making debugging anything else impossible
Casey Ho <caseyho@pidgin.im>
parents:
20846
diff
changeset
|
400 | purple_debug(PURPLE_DEBUG_MISC, "gtkappbar", "wnd_poschanging\n"); |
| 14286 | 401 | |
| 402 | if(ab->docked || ab->docking) { | |
| 403 | wpos->x = ab->docked_rect.left; | |
| 404 | wpos->y = ab->docked_rect.top; | |
| 405 | wpos->cx = ab->docked_rect.right - ab->docked_rect.left; | |
| 406 | wpos->cy = ab->docked_rect.bottom - ab->docked_rect.top; | |
| 407 | if(IsIconic(msg->hwnd)) | |
| 408 | set_toolbar(msg->hwnd, FALSE); | |
| 409 | /*return GDK_FILTER_REMOVE;*/ | |
| 410 | } | |
|
20846
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
411 | |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
412 | if (ab->docked) { |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
413 | if (ab->iconized && wpos->flags & SWP_SHOWWINDOW) |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
414 | show_hide(ab, FALSE); |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
415 | else if (!ab->iconized && wpos->flags & SWP_HIDEWINDOW) |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
416 | show_hide(ab, TRUE); |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
417 | } |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
418 | |
| 14286 | 419 | return GDK_FILTER_CONTINUE; |
| 420 | } | |
| 421 | ||
| 422 | static GdkFilterReturn wnd_exitsizemove(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 423 | MSG *msg = (MSG*)xevent; | |
| 424 | ||
| 15884 | 425 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_exitsizemove\n"); |
| 14286 | 426 | if(ab->docking) { |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
427 | gtk_appbar_setpos(ab, msg->hwnd); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
428 | ab->docking = FALSE; |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
429 | ab->docked = TRUE; |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
430 | ShowWindow(msg->hwnd, SW_HIDE); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
431 | set_toolbar(msg->hwnd, TRUE); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
432 | ShowWindow(msg->hwnd, SW_SHOW); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
433 | gtk_appbar_dispatch_dock_cbs(ab, TRUE); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
434 | } else if(ab->undocking) { |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
435 | ShowWindow(msg->hwnd, SW_HIDE); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
436 | set_toolbar(msg->hwnd, FALSE); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
437 | ShowWindow(msg->hwnd, SW_SHOW); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
438 | gtk_appbar_dispatch_dock_cbs(ab, FALSE); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
439 | ab->undocking = FALSE; |
| 14286 | 440 | } |
| 441 | ||
| 442 | return GDK_FILTER_CONTINUE; | |
| 443 | } | |
| 444 | ||
| 445 | static GdkFilterReturn wnd_showwindow(GtkAppBar *ab, GdkXEvent *xevent) { | |
|
20846
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
446 | MSG *msg = (MSG*)xevent; |
| 14286 | 447 | |
|
20846
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
448 | purple_debug_info("gtkappbar", "wnd_showwindow\n"); |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
449 | if(msg->wParam && ab->docked) { |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
450 | show_hide(ab, FALSE); |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
451 | } else if(!msg->wParam && ab->docked) { |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
452 | show_hide(ab, TRUE); |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
453 | } |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
454 | return GDK_FILTER_CONTINUE; |
| 14286 | 455 | } |
|
20846
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
456 | |
| 14286 | 457 | /** The window's size has changed */ |
| 458 | static GdkFilterReturn wnd_size(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 459 | MSG *msg = (MSG*)xevent; | |
| 460 | ||
| 15884 | 461 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_size\n"); |
| 14286 | 462 | |
| 463 | if(msg->wParam == SIZE_MINIMIZED) { | |
| 15884 | 464 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "Minimize\n"); |
| 14286 | 465 | if(ab->docked) { |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
466 | gtk_appbar_unregister(ab, appbar_get_handle(ab)); |
| 14286 | 467 | ab->docked = TRUE; |
| 468 | } | |
| 469 | } | |
| 470 | else if(msg->wParam == SIZE_RESTORED) { | |
| 15884 | 471 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "Restore\n"); |
| 14286 | 472 | if (!ab->iconized && ab->docked) { |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
473 | gtk_appbar_do_dock(ab, ab->side); |
| 14286 | 474 | } |
| 475 | } | |
| 476 | return GDK_FILTER_CONTINUE; | |
| 477 | } | |
| 478 | ||
| 479 | static GdkFilterReturn wnd_nchittest(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 480 | MSG *msg = (MSG*)xevent; | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
481 | |
| 14286 | 482 | if(ab->docked) { |
| 483 | UINT ret = DefWindowProc(msg->hwnd, msg->message, msg->wParam, msg->lParam); | |
| 484 | ||
| 485 | switch(ret) { | |
| 486 | case HTBOTTOM: | |
| 487 | case HTBOTTOMLEFT: | |
| 488 | case HTBOTTOMRIGHT: | |
| 489 | case HTTOP: | |
| 490 | case HTTOPLEFT: | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
491 | case HTTOPRIGHT: |
| 14286 | 492 | return GDK_FILTER_REMOVE; |
| 493 | case HTLEFT: | |
| 494 | if(ab->side == ABE_LEFT) | |
| 495 | return GDK_FILTER_REMOVE; | |
| 496 | break; | |
| 497 | case HTRIGHT: | |
| 498 | if(ab->side == ABE_RIGHT) | |
| 499 | return GDK_FILTER_REMOVE; | |
| 500 | break; | |
| 501 | } | |
| 502 | } | |
| 503 | return GDK_FILTER_CONTINUE; | |
| 504 | } | |
| 505 | ||
| 506 | #if 0 | |
| 507 | static GdkFilterReturn wnd_initmenupopup(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 508 | MSG *msg = (MSG*)xevent; | |
| 509 | ||
| 510 | if(ab->docked && HIWORD(msg->lParam)) { | |
| 511 | HMENU sysmenu = GetSystemMenu(msg->hwnd, FALSE); | |
| 15884 | 512 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_initpopupmenu: docked: %d ismenu: %d\n", ab->docked, IsMenu(sysmenu)); |
| 14286 | 513 | if(EnableMenuItem(sysmenu, SC_MAXIMIZE, MF_BYCOMMAND|MF_GRAYED)<0) |
| 15884 | 514 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "SC_MAXIMIZE Menu item does not exist\n"); |
| 14286 | 515 | if(EnableMenuItem(sysmenu, SC_MOVE, MF_BYCOMMAND|MF_GRAYED)<0) |
| 15884 | 516 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "SC_MOVE Menu item does not exist\n"); |
| 14286 | 517 | return GDK_FILTER_CONTINUE; |
| 518 | } | |
| 519 | else | |
| 520 | GetSystemMenu(msg->hwnd, TRUE); | |
| 521 | return GDK_FILTER_CONTINUE; | |
| 522 | } | |
| 523 | #endif | |
| 524 | ||
| 525 | static GdkFilterReturn gtk_appbar_callback(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 526 | MSG *msg = (MSG*)xevent; | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
527 | RECT orig, windowRect; |
| 14286 | 528 | |
| 529 | switch (msg->wParam) { | |
| 530 | case ABN_STATECHANGE: | |
| 15884 | 531 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "gtk_appbar_callback: ABN_STATECHANGE\n"); |
| 14286 | 532 | break; |
| 533 | ||
| 534 | case ABN_FULLSCREENAPP: | |
|
25910
d24c4a9d28f2
Changing debug levels. These messages fire every single time a window changes focus, making debugging anything else impossible
Casey Ho <caseyho@pidgin.im>
parents:
20846
diff
changeset
|
535 | purple_debug(PURPLE_DEBUG_MISC, "gtkappbar", "gtk_appbar_callback: ABN_FULLSCREENAPP: %d\n", (BOOL)msg->lParam); |
| 14286 | 536 | if (!ab->iconized && ab->docked) { |
| 537 | if ((BOOL)msg->lParam) { | |
| 538 | SetWindowPos(msg->hwnd, HWND_BOTTOM, 0, 0, 0, 0, | |
| 539 | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); | |
| 540 | } else { | |
| 541 | SetWindowPos(msg->hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, | |
| 542 | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_FRAMECHANGED); | |
| 543 | } | |
| 544 | } | |
| 545 | ||
| 546 | break; | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
547 | case ABN_POSCHANGED: |
| 15884 | 548 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "gtk_appbar_callback: ABN_POSCHANGED\n"); |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
549 | CopyRect(&orig, &(ab->docked_rect)); |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
550 | get_rect_of_window(msg->hwnd, &windowRect); |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
551 | gtk_appbar_querypos(ab, msg->hwnd, windowRect); |
| 14286 | 552 | if (EqualRect(&orig, &(ab->docked_rect)) == 0) { |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
553 | MoveWindow(msg->hwnd, ab->docked_rect.left, ab->docked_rect.top, |
| 14286 | 554 | ab->docked_rect.right - ab->docked_rect.left, |
| 555 | ab->docked_rect.bottom - ab->docked_rect.top, TRUE); | |
| 556 | } | |
| 557 | gtk_appbar_setpos(ab, msg->hwnd); | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
558 | break; |
| 14286 | 559 | #if 0 |
| 560 | default: | |
| 15884 | 561 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "gtk_appbar_callback: %d\n", msg->wParam); |
| 14286 | 562 | #endif |
| 563 | } | |
| 564 | return GDK_FILTER_CONTINUE; | |
| 565 | } | |
| 566 | ||
| 567 | static GdkFilterReturn gtk_appbar_event_filter(GdkXEvent *xevent, GdkEvent *event, gpointer data) { | |
| 568 | MSG *msg = (MSG*)xevent; | |
| 569 | ||
| 570 | /*printf("MSG: %s\n", message_to_string (msg->message));*/ | |
| 571 | switch(msg->message) { | |
| 572 | case WM_EXITSIZEMOVE: | |
| 573 | return wnd_exitsizemove(data, xevent); | |
| 574 | case WM_WINDOWPOSCHANGING: | |
| 575 | return wnd_poschanging(data, xevent); | |
| 576 | case WM_WINDOWPOSCHANGED: | |
| 577 | return wnd_poschanged(data, xevent); | |
| 578 | case WM_ACTIVATE: | |
| 579 | return wnd_activate(data, xevent); | |
| 580 | case WM_SIZING: | |
| 581 | return wnd_sizing(data, xevent); | |
| 582 | case WM_MOVING: | |
| 583 | return wnd_moving(data, xevent); | |
| 584 | case WM_SHOWWINDOW: | |
| 585 | return wnd_showwindow(data, xevent); | |
| 586 | case WM_NCHITTEST: | |
| 587 | return wnd_nchittest(data, xevent); | |
| 588 | #if 0 | |
| 589 | case WM_INITMENUPOPUP: | |
| 590 | return wnd_initmenupopup(data, xevent); | |
| 591 | #endif | |
| 592 | case WM_SIZE: | |
| 593 | return wnd_size(data, xevent); | |
| 594 | case APPBAR_CALLBACK: | |
| 595 | return gtk_appbar_callback(data, xevent); | |
| 596 | #if 0 | |
| 597 | default: | |
| 15884 | 598 | purple_debug_info("gtkappbar", "gtk_appbar_event_filter %d\n", msg->message); |
| 14286 | 599 | #endif |
| 600 | } | |
| 601 | return GDK_FILTER_CONTINUE; | |
| 602 | } | |
| 603 | ||
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
604 | static void gtk_appbar_do_dock(GtkAppBar *ab, UINT side) { |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
605 | RECT orig, windowRect; |
| 14286 | 606 | |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
607 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "gtk_appbar_do_dock\n"); |
| 14286 | 608 | |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
609 | if (!ab || !IsWindow(appbar_get_handle(ab))) |
|
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
610 | return; |
| 14286 | 611 | |
| 612 | ab->side = side; | |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
613 | get_window_normal_rc(appbar_get_handle(ab), &(ab->docked_rect)); |
| 14286 | 614 | CopyRect(&orig, &(ab->docked_rect)); |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
615 | get_rect_of_window(appbar_get_handle(ab), &windowRect); |
|
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
616 | gtk_appbar_querypos(ab, appbar_get_handle(ab), windowRect); |
| 14286 | 617 | if(EqualRect(&orig, &(ab->docked_rect)) == 0) |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
618 | MoveWindow(appbar_get_handle(ab), |
| 14286 | 619 | ab->docked_rect.left, |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
620 | ab->docked_rect.top, |
| 14286 | 621 | ab->docked_rect.right - ab->docked_rect.left, |
| 622 | ab->docked_rect.bottom - ab->docked_rect.top, TRUE); | |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
623 | gtk_appbar_setpos(ab, appbar_get_handle(ab)); |
| 14286 | 624 | ab->docked = TRUE; |
| 625 | } | |
| 626 | ||
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
627 | void gtk_appbar_dock(GtkAppBar *ab, UINT side) { |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
628 | HWND hwnd; |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
629 | |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
630 | g_return_if_fail(ab != NULL); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
631 | |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
632 | hwnd = appbar_get_handle(ab); |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
633 | |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
634 | g_return_if_fail(IsWindow(hwnd)); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
635 | |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
636 | ab->iconized = IsIconic(hwnd); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
637 | |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
638 | if (!ab->docked && !ab->iconized) |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
639 | ShowWindow(hwnd, SW_HIDE); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
640 | gtk_appbar_do_dock(ab, side); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
641 | set_toolbar(hwnd, TRUE); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
642 | if (!ab->iconized) |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
643 | ShowWindow(hwnd, SW_SHOW); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
644 | } |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
645 | |
| 14286 | 646 | void gtk_appbar_add_dock_cb(GtkAppBar *ab, GtkAppBarDockCB dock_cb) { |
| 647 | if(!ab) | |
| 648 | return; | |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
649 | ab->dock_cbs = g_slist_prepend(ab->dock_cbs, dock_cb); |
| 14286 | 650 | } |
| 651 | ||
| 652 | GtkAppBar *gtk_appbar_add(GtkWidget *win) { | |
| 653 | GtkAppBar *ab; | |
| 654 | ||
| 15884 | 655 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "gtk_appbar_add\n"); |
| 14286 | 656 | |
| 657 | if(!win) | |
| 658 | return NULL; | |
| 659 | ab = g_new0(GtkAppBar, 1); | |
| 660 | ab->win = win; | |
| 661 | ||
| 662 | /* init docking coords */ | |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
663 | get_window_normal_rc(appbar_get_handle(ab), &(ab->docked_rect)); |
| 14286 | 664 | |
| 665 | /* Add main window filter */ | |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
666 | gdk_window_add_filter(gtk_widget_get_window(win), |
| 14286 | 667 | gtk_appbar_event_filter, |
| 668 | ab); | |
| 669 | return ab; | |
| 670 | } | |
| 671 | ||
| 672 | void gtk_appbar_remove(GtkAppBar *ab) { | |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
673 | HWND hwnd; |
| 15884 | 674 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "gtk_appbar_remove\n"); |
| 14286 | 675 | |
| 676 | if(!ab) | |
| 677 | return; | |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
678 | |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
679 | hwnd = appbar_get_handle(ab); |
|
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
680 | gdk_window_remove_filter(gtk_widget_get_window(ab->win), |
| 14286 | 681 | gtk_appbar_event_filter, |
| 682 | ab); | |
| 683 | if(ab->docked) { | |
| 684 | gtk_window_resize(GTK_WINDOW(ab->win), | |
| 685 | ab->docked_rect.right - ab->docked_rect.left, | |
| 686 | ab->undocked_height); | |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
687 | if (!ab->iconized) |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
688 | ShowWindow(hwnd, SW_HIDE); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
689 | set_toolbar(hwnd, FALSE); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
690 | if (!ab->iconized) |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
691 | ShowWindow(hwnd, SW_SHOW); |
| 14286 | 692 | } |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
693 | gtk_appbar_unregister(ab, hwnd); |
| 14286 | 694 | |
|
40079
a37a1e349491
Replace g_[s]list_remove with g_[s]list_delete_link.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35896
diff
changeset
|
695 | g_slist_free(ab->dock_cbs); |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
696 | |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
697 | g_free(ab); |
| 14286 | 698 | } |