Ticket #5: 20-nd-theme-standard-multihead-support.patch
-
src/themes/standard/theme.c
old new 237 237 get_notification_arrow_type(GtkWidget *nw) 238 238 { 239 239 WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata"); 240 int screen_height;241 240 242 screen_height = gdk_screen_get_height( 243 gdk_drawable_get_screen(GDK_DRAWABLE(nw->window))); 241 GdkScreen *screen; 242 int monitor; 243 GdkRectangle monitor_geometry; 244 245 screen = gdk_drawable_get_screen(GDK_DRAWABLE(nw->window)); 246 monitor = gdk_screen_get_monitor_at_point(screen, windata->point_x, windata->point_y); 247 gdk_screen_get_monitor_geometry(screen, monitor, &monitor_geometry); 244 248 245 if ( windata->point_y+ windata->height + DEFAULT_ARROW_HEIGHT >246 screen_height)249 if ((windata->point_y - monitor_geometry.y) + windata->height + DEFAULT_ARROW_HEIGHT > 250 monitor_geometry.height) 247 251 { 248 252 return GTK_ARROW_DOWN; 249 253 } … … 270 274 int y; 271 275 GtkArrowType arrow_type; 272 276 GdkScreen *screen; 273 int screen_width;274 int screen_height;275 277 int arrow_side1_width = DEFAULT_ARROW_WIDTH / 2; 276 278 int arrow_side2_width = DEFAULT_ARROW_WIDTH / 2; 277 279 int arrow_offset = DEFAULT_ARROW_OFFSET; 278 280 GdkPoint *shape_points = NULL; 279 281 int i = 0; 282 int monitor; 283 GdkRectangle monitor_geometry; 280 284 281 285 width = windata->width; 282 286 height = windata->height; 283 287 284 288 screen = gdk_drawable_get_screen(GDK_DRAWABLE(nw->window)); 285 screen_width = gdk_screen_get_width(screen);286 screen_height = gdk_screen_get_height(screen);289 monitor = gdk_screen_get_monitor_at_point(screen, windata->point_x, windata->point_y); 290 gdk_screen_get_monitor_geometry(screen, monitor, &monitor_geometry); 287 291 288 292 windata->num_border_points = 5; 289 293 … … 294 298 { 295 299 case GTK_ARROW_UP: 296 300 case GTK_ARROW_DOWN: 297 if ( windata->point_x< arrow_side1_width)301 if ((windata->point_x - monitor_geometry.x) < arrow_side1_width) 298 302 { 299 303 arrow_side1_width = 0; 300 304 arrow_offset = 0; 301 305 } 302 else if ( windata->point_x > screen_width - arrow_side2_width)306 else if ((windata->point_x - monitor_geometry.x) > (monitor_geometry.width - arrow_side2_width)) 303 307 { 304 308 arrow_side2_width = 0; 305 309 arrow_offset = width - arrow_side1_width; 306 310 } 307 311 else 308 312 { 309 if ( windata->point_x- arrow_side2_width + width >=310 screen_width)313 if ((windata->point_x - monitor_geometry.x) - arrow_side2_width + width >= 314 monitor_geometry.width) 311 315 { 312 316 arrow_offset = 313 317 width - arrow_side1_width - arrow_side2_width - 314 ( screen_width - MAX(windata->point_x+318 (monitor_geometry.width - MAX((windata->point_x - monitor_geometry.x) + 315 319 arrow_side1_width, 316 screen_width -320 monitor_geometry.width - 317 321 DEFAULT_ARROW_OFFSET)); 318 322 } 319 323 else 320 324 { 321 arrow_offset = MIN( windata->point_x- arrow_side1_width,325 arrow_offset = MIN((windata->point_x - monitor_geometry.x) - arrow_side1_width, 322 326 DEFAULT_ARROW_OFFSET); 323 327 } 324 328 … … 439 443 440 444 case GTK_ARROW_LEFT: 441 445 case GTK_ARROW_RIGHT: 442 if ( windata->point_y< arrow_side1_width)446 if ((windata->point_y - monitor_geometry.y) < arrow_side1_width) 443 447 { 444 448 arrow_side1_width = 0; 445 arrow_offset = windata->point_y;449 arrow_offset = (windata->point_y - monitor_geometry.y); 446 450 } 447 else if ( windata->point_y > screen_height - arrow_side2_width)451 else if ((windata->point_y - monitor_geometry.y) > monitor_geometry.height - arrow_side2_width) 448 452 { 449 453 arrow_side2_width = 0; 450 arrow_offset = windata->point_y- arrow_side1_width;454 arrow_offset = (windata->point_y - monitor_geometry.y) - arrow_side1_width; 451 455 } 452 456 break; 453 457
